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