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