import std.stdio,
       std.string,
       std.conv;

R delegate(Args) Z(R, Args...)(R delegate(R delegate(Args), Args) f){
  return (Args args) => f(Z(f), args);
}

void main() {
  (N => 
    (Fibonacci =>
      Fibonacci(1, 1, N)
    )(Z((ulong delegate(ulong, ulong, ulong)solver, ulong n1, ulong n2, ulong N) =>
        0 < N ? solver(n1 + n2, n1, N - 1) : n2)
  ))(readln.chomp.to!ulong).writeln;
}