var m: array [1..20] of integer;
n, ch, ost : integer;
begin
readln(n);
while n > = 2 do
ch : = n div 2;
ost : = n mod 2;
m[] : = ost;
end;
writeln( m[]);
end.
var m: array [1..20] of integer;
n, ch, ost : integer;
begin
readln(n);
while n > = 2 do
begin
ch : = n div 2;
ost : = n mod 2;
m[] : = ost;
end;
writeln( m[]);
end.