#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k, res;
  cin >> n >> m >> k;
  res = 0;
  if (n + m - 2 < k)
    res = -1;
  else {
    if (n >= k + 1) {
      res = max(res, n / (k + 1) * m);
    } else {
      res = max(res, m / (k - n + 2));
    }
    if (m >= k + 1) {
      res = max(res, m / (k + 1) * n);
    } else {
      res = max(res, n / (k - m + 2));
    }
  }
  cout << res << endl;
}
