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