let id x = x
let n = Scanf.scanf "%d\n" id

let rec lucas n =
  let rec lucas_pair n =
    match n with
    | 0 -> (2,0)
    | 1 -> (1,2)
    | m -> let (i,j) = lucas_pair (n-1) in (i+j,i)
  in let (i,_) = lucas_pair n in i

let ans = lucas n

let () =
  Printf.printf "%d\n" ans