#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
Discussion Solution Statistics Submit

Dynamic Programming - Fibonacci Number
Time Limit : 1 sec, Memory Limit : 65536 KB
=end
class Fib
  def initialize
    @fib = Hash.new
  end

  def fib(i)
    if @fib.key?(i) then
      @fib[i]
    elsif i==0 then
      @fib[0] = 1
    elsif i==1 then
      @fib[1] = 1
    else
      @fib[i] = fib(i-1) + fib(i-2)
    end
  end

end

class Main

  def initialize()
    fh=STDIN
    n = fh.gets.to_i
    f = Fib.new
    puts f.fib(n)
  end

end

if $0 == __FILE__ then
  Main.new
end