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