def fib(n):
if n == 0:
return 0
old, new = 0, 1
for i in range(n-1):
old, new = new, old + new
return new