#include <bits/stdc++.h>
using namespace std;
long long solve(int n, int m, int k) {
  if (k < n) return 1LL * n / (k + 1) * m;
  k -= n - 1;
  return 1LL * m / (k + 1);
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  long long ans = max(solve(n, m, k), solve(m, n, k));
  if (k > n + m - 2) {
    cout << -1;
  } else
    printf("%I64d", ans);
  return 0;
}
