(* メモテーブル *)
let memo_table = Array.make 100 None

let rec lucas n =
  match memo_table.(n + 1) with
    Some (v) -> v
  | None ->
    let result = 
    	if n = 0 then 2 else if n = 1 then 1
        else lucas(n - 1) + lucas(n - 2) in
    (memo_table.(n + 1) <- Some result;
     result)
     
(* メイン関数 *)     
let go () =
	let v = read_line() in
    let result = lucas (int_of_string v) in
    print_int result
    
let _ = go()