import Control.Monad.Trans.State

main = do
  n <- readLn
  print $ lucas n
 
lucas :: Int -> Int
lucas n = execState (step n) (2, 1)

step :: Int -> State (Int, Int) Int
step 0 = return . fst <$> get
step 1 = return . snd <$> get
step n = do
  (x, y) <- get
  put (y, x+y)
  step $ n - 1
  