Program Zif_4_12_I(input,output);
Var k,n:integer;
begin
     read(k);
     n:=trunc((sqrt(1+8*k)-1)/2);
     if k=1 then write(1)
     else
     if k-(n*n+n)/2=1 then writeln(1)
     else writeln(0)
End.