#include <bits/stdc++.h>
using namespace std;
template <class T>
T nextInt() {
  T x = 0, p = 1;
  char c;
  do {
    c = getchar();
  } while (c <= 32);
  if (c == '-') {
    p = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * p;
}
long long n, m, k;
long long f(long long kn) {
  long long w = n / (kn + 1);
  long long km = k - kn;
  long long h = m / (km + 1);
  return w * h;
}
int main() {
  cin >> n >> m >> k;
  if (n + m - 2 < k) {
    cout << "-1\n";
    return 0;
  }
  if (n < m) swap(n, m);
  long long res = f(min(k, n - 1));
  swap(n, m);
  res = max(res, f(min(k, n - 1)));
  cout << res << "\n";
  return 0;
}
