#include <bits/stdc++.h>
using namespace std;
long long a[10000001] = {};
long long a1, a2, n;
void read(long long &n) {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' or ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' and ch <= '9') {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  n = x * f;
}
void write(long long n) {
  if (n >= 10) write(n / 10);
  putchar(n % 10 + 48);
}
long long f(long long n) {
  if (n == 1) return a1;
  if (n == 2) return a2;
  if (a[n])
    return a[n];
  else
    return a[n] = f(n - 1) + f(n - 2);
}
int main() {
  read(a1);
  read(a2);
  read(n);
  n += 1;
  write(f(n));
  return 0;
}
