#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e18 + 7;
const long long mod = 1e9 + 7;
const double eps = 1e-12;
const double PI = 2 * acos(0.0);
const double E = 2.71828;
long long n, m, k;
long long f(long long n, long long m, long long k) {
  if (n - 1 >= k) return n / (k + 1) * m;
  return m / (k - (n - 1) + 1);
}
int main(void) {
  cin >> n >> m >> k;
  long long res = -inf;
  if (n + m - 2 < k) {
    puts("-1");
    exit(0);
  }
  res = max(res, f(n, m, k));
  res = max(res, f(m, n, k));
  cout << res << "\n";
  return 0;
}
