def read_int(): return int(input()) def read_int_list(): return list(map(int, input().split())) def fast_doubling(i): if i == 0: return 0, 1 elif i == 1: return 1, 1 else: a, b = fast_doubling(i >> 1) if i & 1: return a * a + b * b, b * (2 * a + b) else: return a * (2 * b - a), a * a + b * b def fibonacci_number(i): _, ret = fast_doubling(i) return ret print(fibonacci_number((read_int())))