module Main where

import Control.Applicative
import Control.Monad
import Data.Array

lucas :: Int -> Int
lucas n = iter n
  where
    memo = listArray (0, n) $ fmap iter [0 .. n]
    iter 0 = 2
    iter 1 = 1
    iter k = memo ! (k - 1) + memo ! (k - 2)

main :: IO ()
main = do
    n <- readLn :: IO Int
    print $ lucas n