(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let n = Scanf.sscanf (read_line ()) "%d" ( fun n -> n)

let rec f lst n =
        match lst with
                  [] -> 0
                | first :: [] -> 0 
                | first :: second :: rest -> 
                        let luca = first + second in
                                if n = 0 then
                                        luca
                                else
                                        f (luca :: lst) (n - 1)

let () =
        (
                if n = 0 then
                        2
                else
                if n = 1 then
                        1
                else
                        f [1; 2] (n - 2)
        )
        |> Printf.printf "%d\n"
