while a=gets() b=a.to_i 2 while b>1=0 b-=i+=1 end p b==0 ?1:0end