#
# Author: Arpit Bhayani
# https://arpitbhayani.me
#
x = raw_input().split()
dp = {}
def fib(t1, t2, n):
if n == 1:
return t1
if n == 2:
return t2
t3 = dp.get(n)
if t3 is None:
t3 = fib(t1, t2, n-2) + fib(t1, t2, n-1) ** 2
dp[n] = t3
return t3
print fib(int(x[0]), int(x[1]), int(x[2]))
System Design for Beginners
A masterclass that helps early engineers and product managers become great at designing scalable systems.
132+ learners
Details →System Design Masterclass
A masterclass that helps you become great at designing scalable, fault-tolerant, and highly available systems.
1000+ learners
Details →Redis Internals
Learn internals of Redis by re-implementing some of the core features in Golang.
98+ learners
Details →