#include <bits/stdc++.h>
long long max(long long a, long long b) { return a > b ? a : b; }
int main() {
  long long n, m, k, maxn = 0;
  while (~scanf("%I64d%I64d%I64d", &n, &m, &k)) {
    if (n + m - 2 < k) {
      puts("-1");
      continue;
    }
    if (k < n) maxn = max(maxn, m * (n / (k + 1)));
    if (k < m) maxn = max(maxn, n * (m / (k + 1)));
    if (k >= n) maxn = max(maxn, m / (k - n + 2));
    if (k >= m) maxn = max(maxn, n / (k - m + 2));
    printf("%I64d\n", maxn);
  }
  return 0;
}
