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