module Main where
import Debug.Trace
import Data.List
import qualified Data.Sequence as S
import qualified Data.ByteString.Char8 as B
import Data.Int
import Data.Char
import Data.Array
import Data.Maybe
import qualified Data.Map as M
import Data.Ord
import Data.Functor
import Control.Applicative
import Control.Monad

fib :: Int -> Int
fib = iter (listArray (0, 44) [x| x <- 1:1:(replicate 43 0)]) 2 where
    iter ar i n 
        | i <= n = iter (ar // [(i, ar!(i-1) + ar!(i-2))]) (i+1) n
        | otherwise = ar!n

readIntLn:: IO Int
readIntLn = (fst . fromJust . B.readInt) <$> B.getLine

main :: IO() 
main = do
    n <- readIntLn
    print $ fib n

