#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long count(long long bb) {
  if (k + 2 - bb <= 0) return -1;
  return (m / bb) * (n / (k + 2 - bb));
}
int main() {
  cin >> n >> m >> k;
  if (n + m < k + 2)
    printf("-1\n");
  else {
    long long ans = 0;
    if (n > m) swap(n, m);
    long long l = 1, r;
    l = max(k + 2 - n, l);
    r = min(k + 2, m);
    for (int i = l; i <= r; i++) {
      if (count(i) > 0) {
        ans = count(i);
        break;
      }
    }
    for (int i = r; i >= l; i--) {
      if (count(i) > 0) {
        ans = max(ans, count(i));
        break;
      }
    }
    cout << ans;
  }
  return 0;
}
