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