#include <bits/stdc++.h>
using namespace std;
int main() {
  int k1, k2, n;
  cin >> k1 >> k2 >> n;
  if (n == 0) {
    cout << k1 << endl;
    return 0;
  }
  if (n == 1) {
    cout << k2 << endl;
    return 0;
  }
  for (int i = 2; i <= n; i++) {
    k2 = k2 + k1;
    k1 = k2 - k1;
  }
  cout << k2 << endl;
}
