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

void main() {
  auto N = readln.chomp.to!int;
  auto a = 2;
  auto b = 1;
  if (N == 1) {
    writeln(b);
    return;
  }
  while (N != 1) {
    auto c = a + b;
    a = b;
    b = c;
    N--;
  }
  writeln(b);
}