var n:integer;
begin
read(n);
if (n=1) or (n=2) then writeln('1') else
if n
if n mod 3 = 0 then writeln('2')
else writeln('1')
else if (n-1000) mod 3=0 then writeln('1')
else writeln('2')
end.
var n:integer;
begin
read(n);
if (n=1) or (n=2) then write('1') else
if n
if n mod 3 = 0 then writeln('2')
else writeln('1')
else if (n-1000) mod 3=0 then write('1')
else writeln('2')
end.