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