Problem: Many of you know the famous Fibonacci sequence F:
F[1] = 1
F[2] = 1
F[i] = F[i - 1] + F[i - 2] for i > 2

Thus each number in sequence is a sum of two previous numbers except two first which are define as 1.

You've decided to create you own Fibonacci sequence. It's very similar to the one described above, but the first two numbers now are arbitrary non-negative integers A and B ( F[1] = A and F[2] = B ). Now you want to compute the N-th number in your sequence.

Input
The only line contains 3 space-separated integers A, B, N.

Output
Output one integer - the N-th number in your sequence.

Constraints
0 < A, B, N ≤ 10

SAMPLE INPUT
1 3 4

SAMPLE OUTPUT
7

Solution (in PYTHON):

Solution:
def prevPowTwo(n):
    'Gets the power of two that is less than or equal to the given input'
    if ((n & -n) == n):
        return n
    else:
        n -= 1
        n |= n >> 1
        n |= n >> 2
        n |= n >> 4
        n |= n >> 8
        n |= n >> 16
        n += 1
        return (n/2)
 
def crazyFib(n):
    'Crazy fast fibonacci number calculation'
    powTwo = prevPowTwo(n)
    q = r = i = 1
    s = 0
    while i < powTwo:
        i *= 2
        q, r, s = q*q + r*r, r * (q + s), (r*r + s*s)
    while i < n:
        i += 1
        q, r, s = q+r, q, r
    return q, r


a, b, n = [int(x) for x in raw_input().split()]
if n == 1:
    print a
elif n == 2:
    print b
else:
    q, r = crazyFib(n - 2)
    print (r * a) + (q * b)