#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  while (cin >> n >> m >> k) {
    long long ans = -1;
    long long totcut = n + m - 2;
    if (k > totcut) {
      cout << ans << endl;
      continue;
    }
    ++k;
    long long maxx = max(n, m);
    long long minn = min(n, m);
    if (k - 1 <= minn - 1) {
      long long t1 = minn / k, t2 = maxx / k;
      long long t3 = t1 * maxx, t4 = t2 * minn;
      ans = max(t3, t4);
      cout << ans << endl;
      continue;
    }
    if (k - 1 <= maxx - 1) {
      long long t2 = maxx / k;
      long long t4 = t2 * minn;
      long long t3 = maxx / (k - minn + 1);
      ans = max(t3, t4);
      cout << ans << endl;
      continue;
    } else {
      long long k1 = k - 1 - (maxx - 1), k2 = k - 1 - (minn - 1);
      ans = max(minn / (k1 + 1), maxx / (k2 + 1));
      cout << ans << endl;
      continue;
    }
  }
  return 0;
}
