local function reada(n,m)m=m or 1 r={}for i=1,m do r[i]={}end for i=1,n do for j=1,m do r[j][i]=io.read"*n"end end return unpack(r)end

local a
for i=1,5 do
if(io.read"*n"==0)then a=i break end
end
print(a)