{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = readLn >>= print . lucas 2 1 0

lucas :: Integer -> Integer -> Int -> Int -> Integer
lucas !a _ _ 0 = a
lucas _ !b _ 1 = b
lucas !a !b k n
	| k == n = a
	| otherwise = lucas b ( a + b ) ( k + 1 ) n
