#include <bits/stdc++.h>
using namespace std;
const double eps = 1.0e-6;
long long x, y, n;
long long a[105];
int main() {
  cin >> x >> y >> n;
  if (x + y - 2 < n) {
    cout << -1 << endl;
    return 0;
  }
  long long ans1, ans2;
  if (x > n + 1) {
    ans1 = y * (x / (n + 1));
  } else {
    ans1 = y / (n - (x - 1) + 1);
  }
  if (y > n + 1) {
    ans2 = x * (y / (n + 1));
  } else {
    ans2 = x / (n - (y - 1) + 1);
  }
  cout << max(ans1, ans2) << endl;
}
