#include <bits/stdc++.h>
using namespace std;
int main() {
  long long p[31], a, b, c;
  p[0] = 0, p[1] = 1, p[2] = 1;
  for (int i = 3; i <= 30; ++i) {
    p[i] = p[i - 1] + p[i - 2];
  }
  while (cin >> a >> b >> c) {
    cout << a * p[c - 1] + b * p[c] << endl;
  }
  return 0;
}
