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