#include <bits/stdc++.h>
using namespace std;
ifstream fin("contest.in");
ofstream fout("contest.out");
const long long N = 2 * 1000 * 1000 * 1000 + 10, inf = 1000 * 1000 * 1000;
long long n, m, k, res = 0, s;
vector<long long> nn, mm;
int main() {
  cin >> n >> m >> k;
  if (n + m - 2 < k) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= sqrt(n); i++)
    if (n % i == 0) {
      nn.push_back(i);
      nn.push_back(n / i);
    }
  for (int i = 1; i <= sqrt(m); i++)
    if (m % i == 0) {
      mm.push_back(i);
      mm.push_back(m / i);
    }
  for (int i = 0; i < nn.size(); i++) {
    if (k - nn[i] > m || k < nn[i] - 1) continue;
    if (k == nn[i] - 1) {
      res = (n / nn[i]) * m;
      break;
    }
    s = (n / nn[i]) * (m / (k - nn[i] + 2));
    res = max(s, res);
  }
  for (int i = 0; i < mm.size(); i++) {
    if (k - mm[i] > n || k < mm[i] - 1) continue;
    if (k == mm[i] - 1) {
      res = (m / mm[i]) * n;
      break;
    }
    s = (m / mm[i]) * (n / (k - mm[i] + 2));
    res = max(s, res);
  }
  cout << res;
  return 0;
}
