#include <bits/stdc++.h>
using namespace std;
vector<long long> rv;
vector<long long> cv;
long long n, m, k;
void ge(long long c, vector<long long> &v) {
  for (long long i = 1; i * i <= c; i++) {
    if (c % i == 0) v.push_back(i - 1), v.push_back(c / i - 1);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
}
int main() {
  cin >> n >> m >> k;
  if (n + m - 2 < k)
    cout << -1 << endl;
  else {
    if (n < m) swap(n, m);
    ge(n, rv), ge(m, cv);
    int z = lower_bound(rv.begin(), rv.end(), k) - rv.begin();
    long long sb = 0;
    for (int i = 0; i < rv.size(); i++) {
      if (k >= rv[i]) {
        sb = max(sb, (long long)(n / (rv[i] + 1)) * (m / (k - rv[i] + 1)));
        sb = max(sb, (long long)(m / (rv[i] + 1)) * (n / (k - rv[i] + 1)));
      }
    }
    for (int i = 0; i < cv.size(); i++) {
      if (k >= cv[i]) {
        sb = max(sb, (long long)(n / (cv[i] + 1)) * (m / (k - cv[i] + 1)));
        sb = max(sb, (long long)(m / (cv[i] + 1)) * (n / (k - cv[i] + 1)));
      }
    }
    cout << sb << endl;
  }
  return 0;
}
