Kirchhoff's rules

The currents into any junction add up to the currents out, because charge is conserved, and the voltage changes round any closed loop add up to zero, because energy is; together they solve any DC circuit.

From Physics 2.