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