Program Zif_3_29_d(input,output);
Var a:real;
    b:integer;
    otv:boolean;
Begin
     read(a);
     b:=trunc(a*1000) mod 10000;
     otv:=(b div 1000)*(b div 100 mod 10)*(b mod 10) = 0;
     writeln(otv)
End.