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