import java.util.*

/**
 * Created by Shadab on 26-Nov-17.
 */
fun main(args: Array<String>){

    //Generating Lucas numbers array.
    var lucas: Array<Long?> = kotlin.arrayOfNulls<Long>(87)

    lucas.set(0, 2)
    lucas.set(1, 1)

    for (i in 2..86) {
        var total = lucas.get(i - 1) as Long + lucas.get(i - 2) as Long
        lucas.set(i, total)
    }

    //taking user input for Lucas number position
    var sc =  Scanner(System.`in`)

    while(sc.hasNext()) {

        var n = sc.nextInt();
        println(lucas.get(n))
    }

}
