i="" while 1:i=1-(1+8*int(input(i),2))**.5//1