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