Program Zif_3_29_E(input,output);
Var a:integer;
    otv:boolean;
Begin
     read(a);
     otv:=(a div 100 - a mod 10)*(a div 10 mod 10 - a div 100)*(a div 10 mod 10 - a mod 10)=0;
     writeln(otv)
End.