#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 34;
const long long md = 1e9 + 7;
const long long p = 31;
long long n, m, k, ans, kn, ky;
long long x, y;
void relax(long long kx) {
  ky = k - kx;
  x = n / (kx + 1);
  y = m / (ky + 1);
  ans = max(ans, x * y);
}
int main() {
  cin >> n >> m >> k;
  if (k > n + m - 2) {
    cout << -1;
    return 0;
  }
  kn = k * n / (n + m);
  for (long long i = max(0ll, kn - 100000); i <= min(k, kn + 100000); i++)
    relax(i);
  for (long long i = 0; i <= min(100000ll, k); i++) relax(i);
  for (long long i = max(0ll, k - 100000ll); i <= k; i++) relax(i);
  kn = n;
  for (long long i = max(0ll, kn - 100000); i <= min(k, kn + 100000); i++)
    relax(i);
  kn = m;
  for (long long i = max(0ll, kn - 100000); i <= min(k, kn + 100000); i++)
    relax(k - i);
  cout << ans;
}
