n = gets.to_i fib = Array.new(n + 1) fib[0] = fib[1] = 1 2.upto(n){|i| fib[i] = fib[i - 2] + fib[i - 1]} puts fib[n]