function fibo(M,N,R:integer):integer;
var x:real;
begin
if (N=1) then fibo:=0
else if (N=2) then fibo:=1
else begin
x:=M*1.618;
if N=(R+2) then fibo:=M
else fibo:=fibo(round(x),N,R+1);
end;
end;
var N : integer;
begin
readln(N);
writeln(fibo(1,N,0));
end.
ZnVuY3Rpb24gZmlibyhNLE4sUjppbnRlZ2VyKTppbnRlZ2VyOwp2YXIgeDpyZWFsOwpiZWdpbgogaWYgKE49MSkgdGhlbiBmaWJvOj0wCiBlbHNlIGlmIChOPTIpIHRoZW4gZmlibzo9MQogZWxzZSBiZWdpbgogICB4Oj1NKjEuNjE4OwogICBpZiBOPShSKzIpIHRoZW4gZmlibzo9TQogICBlbHNlIGZpYm86PWZpYm8ocm91bmQoeCksTixSKzEpOwogZW5kOwplbmQ7Cgp2YXIgTiA6IGludGVnZXI7CgpiZWdpbgogIHJlYWRsbihOKTsKICB3cml0ZWxuKGZpYm8oMSxOLDApKTsKZW5kLg==