import Control.Monad.Trans.State
 
main = do
  n <- readLn
  print $ lucas n
 
lucas :: Int -> Int
lucas n = evalState (step n) (2, 1)
 
step :: Int -> State (Int, Int) Int
step 0 = do
  (x, y) <-  get
  return x
step 1 = do
  (x, y) <- get
  return y
step n = do
  (x, y) <- get
  put (y, x+y)
  step $ n - 1