#include <bits/stdc++.h>
using namespace std;
long long min(long long a, long long b) { return a > b ? b : a; }
long long max(long long a, long long b) { return a > b ? a : b; }
long long n, m;
long long k, t;
int main() {
  scanf("%I64d%I64d%I64d", &n, &m, &k);
  if (m + n - 2 < k) {
    cout << -1;
    return 0;
  } else if (k < min(m, n)) {
    cout << max(m / (k + 1) * n, n / (k + 1) * m);
    return 0;
  } else if (min(m, n) <= k && k < max(m, n)) {
    if (m < n) {
      t = n;
      n = m;
      m = t;
    }
    cout << max(m / (k + 1) * n, m / (k - n + 2));
    return 0;
  } else if (k >= max(m, n)) {
    cout << max(m / (k - n + 2), n / (k - m + 2));
    return 0;
  }
  return 0;
}
