Write a program that calculates the nth number in Fibonacci series.