fun main(args: Array<String>) {
    val n = readLine()?.toInt() ?: return
    val fibonacci = Fibonacci()
    println(fibonacci.getFibonacci(n))
}

class Fibonacci {
    private val fibonacciMemo = mutableMapOf(0 to 1, 1 to 1)

    fun getFibonacci(n: Int): Int {
        return if (fibonacciMemo[n] != null) {
            fibonacciMemo[n]!!
        } else {
            fibonacciMemo[n] = getFibonacci(n - 2) + getFibonacci(n - 1)
            fibonacciMemo[n]!!
        }
    }
}
