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