#include <bits/stdc++.h>
using namespace std;
long long MIN(long long a, long long b) { return a < b ? a : b; }
long long MAX(long long a, long long b) { return a + b - MIN(a, b); }
int main() {
  long long n, m, k, ans;
  cin >> n >> m >> k;
  if (n > m) swap(n, m);
  if ((n + m - 2) < k)
    ans = -1;
  else {
    ans = 0;
    if (k <= n - 1) {
      ans = MAX(n / (k + 1) * m, m / (k + 1) * n);
    } else if (k <= m - 1) {
      ans = m / (k + 1) * n;
    } else {
      ans = MAX(m / (k - n + 2), n / (k - m + 2));
    }
  }
  cout << ans << endl;
}
