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