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