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