#include <bits/stdc++.h>
using namespace std;
// debug /*{{{*/
#define debug(...) __dbg(#__VA_ARGS__, __VA_ARGS__)
template<typename T> concept Container = ranges::range<T> && !convertible_to<T, string_view>;
template<typename T, typename U> ostream& operator<<(ostream& out, const pair<T, U>& v);
template<typename... Args> ostream& operator<<(ostream& out, const tuple<Args...>& v);
template<Container T> ostream& operator<<(ostream& out, const T& v);
template<typename T, typename U>
ostream& operator<<(ostream& out, const pair<T, U>& v) {
out << '(' << v.first << ' ' << v.second << ')';
return out;
}
template<typename... Args>
ostream& operator<<(ostream& out, const tuple<Args...>& v) {
string _;
out << '(';
apply([&](auto&&... x) { (..., (out << _ << x, _ = " ")); }, v);
out << ')';
return out;
}
template<Container T>
ostream& operator<<(ostream& out, const T& v) {
string _;
out << '(';
for (auto i : v) out << _ << i, _ = " ";
out << ')';
return out;
}
template<typename ...Args>
void __dbg(string s, Args&&... x) {
string _;
cerr << '(' << s << ") : ";
(..., (cerr << _ << x, _ = ", "));
cerr << endl;
}
/*}}}*/
using i64 = long long;
auto naive = [](int n, i64 a, i64 b) {
vector f(n, i64(0));
f[1] = 1;
for (int i = 2; i <= n - 1; i++) f[i] = f[i - 1] + f[i - 2];
set s{ i64(0) }; s.clear();
for (i64 x = 1; x <= a; x++) {
for (i64 y = 1; y <= b; y++) {
s.insert(f[n - 2] * x + f[n - 1] * y);
}
}
return (i64)s.size();
};
auto sol = [](int n, i64 a, i64 b) {
if (n >= 46) return a * b;
vector f(n + 1, i64(0));
f[1] = 1;
for (int i = 2; i <= n; i++) f[i] = f[i - 1] + f[i - 2];
if (a <= f[n - 1]) return a * b;
if (b <= f[n - 2]) return a * b;
return f[n - 2] * a + f[n - 1] * b - f[n - 2] * f[n - 1];
};
auto test = [] {
for (int n = 3; n <= 10; n++) {
for (int a = 1; a <= 100; a++) {
debug(n, a);
for (int b = 1; b <= 100; b++) {
i64 r1 = naive(n, a, b);
i64 r2 = sol(n, a, b);
if (r1 == r2) continue;
debug(n, a, b, r1, r2);
exit(0);
}
}
}
exit(0);
};
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, a, b; cin >> a >> b >> n;
cout << sol(n, a, b) << '\n';
}