program binacy;
var
f:array [1..1000000] of longint;
n:longint;
f1,f2:text;
procedure init;
begin
assign(f1,'binacy.in'); reset(f1);
assign(f2,'binacy.out'); rewrite(f2);
readln(f1,n);
close(f1);
end;
procedure play;
var i:longint;
begin
f[1]:=1;
f[2]:=2;
for i:=3 to n do begin
f[i]:=f[i-1]+f[i-2];
f[i]:=f[i] mod 15746;
end;
writeln(f2,f[n] mod 15746);
close(f2);
end;
begin
init;
play;
end.