import scala.io.StdIn

object Main{
  def fib(prev: (Long, Long), pos: Int)(n: Int): Long = {
    if(n < 2) 1
    else if(pos >= n) prev._1 + prev._2
    else fib((prev._2, prev._1+prev._2), pos+1)(n)
  }

  def main(args: Array[String]) {
    val n = StdIn.readInt()
    println(fib((1,1), 2)(n))
    //(0 to 10).map(fib((1,1), 2)).foreach(println)
  }
}