import scala.io.StdIn._
import scala.collection.mutable

object Main extends App {
  def fibonacci(n: Int, memo: mutable.Map[Int, Long] = mutable.Map[Int, Long]()): Long = n match {
    case x if (x == 0 || x == 1) => { memo += (x -> 1); 1 }
    case x if memo.get(x) != None => memo(x)
    case x => {
      memo += (x -> (fibonacci(n - 2, memo) + fibonacci(n - 1, memo)))
      memo(x)
    }
  }

  val N = readLine.toInt
  println(fibonacci(N))
}
