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