program step10(inpu,output);
var k,cif:integer;
    a:real;
begin
 writeln('vvedite k');read(k);
 a:=sqrt(8*k-7);
 if a-trunc(a)=0 then cif:=1 else cif:=0;
 writeln(cif)
end.