// abc079-b
object Main extends App {
  val n = io.StdIn.readInt

  /* stackoverflow case
  def lucas(i: Int): Long = i match {
    case 0 => 2.toLong
    case 1 => 1.toLong
    case j => lucas(j-1) + lucas(j-2)
  }

  val result = lucas(n)
  println(result)
  */

  // lazy eval and memorize!
  def lucasFrom(a: Long, b: Long): Stream[Long] = a #:: lucasFrom(b, a+b)
  val lucas = lucasFrom(2, 1)
  println(lucas.take(n+1).last)
}