Program Zif_6_41_M(input,output);
var c:char;
    k,i:integer;
    q:boolean;
begin
     read(c);q:=false;i:=0;k:=0;
     while (c<>'.') do
     begin
          i:=i+1;
          if (c>='0')and(c<='9')and(k=0) then
          begin
               k:=k*16+ord(c)-ord('0');
               q:=true
          end;
          read(c)
     end;
     writeln((k=i)and(q))
end.