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