var
a,b,c:array[1..5000] of longint;
n,l:longint;
proceduregjj;var
i:longint;
begin
fillchar(c,sizeof(c),0);
for i:=1to l dobegin
c[i]:=c[i]+a[i]+b[i];
if c[i]>=10thenbegin
c[i]:=c[i]-10;
inc(c[i+1]);
end;
end;
if c[l+1]<>0then inc(l);
end;
var
i:longint;
begin
readln(n);
if n=0thenbegin writeln(0);exit;end;
if n=1thenbegin writeln(1);exit;end;
if n=2thenbegin writeln(2);exit;end;
a[1]:=1;
b[1]:=2;
l:=1;
for i:=1to n-2dobegin
gjj;
a:=b;
b:=c;
end;
for i:=l downto1dowrite(c[i]);
end.