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