Var n:longint;
Begin
  readln(n);
  writeln(n mod 5=0);
End.