Each row of n cells connected in series provides emf = nE . The equivalent resistance of each row is also nr. Hence for m rows (parallel connection) the net equivalent resistance becomes (nr)/m.
The emf across the external resistance R is nE.
Hence main current of the circuit
if r=0 then I =nE/R