var s,t:string;begin repeat readln(s);repeat t:=s;s:=copy(s,2);write(1and(ord(t[1])+ord(pos("0",s)=0)))until s="";writeln until 0>0end.