#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  while (cin >> n >> m >> k) {
    if ((n + m - 2) < k) {
      printf("-1\n");
      continue;
    }
    long long max = 0, t;
    if (n > m) {
      t = m;
      m = n;
      n = t;
    }
    long long ans;
    if (m >= (k + 1)) {
      ans = (n / (k + 1) * m) > (m / (k + 1) * n) ? (n / (k + 1) * m)
                                                  : (m / (k + 1) * n);
    } else {
      ans = (m / (k - (n - 1) + 1)) > (n / (k - (m - 1) + 1))
                ? (m / (k - (n - 1) + 1))
                : (n / (k - (m - 1) + 1));
    }
    cout << ans << endl;
  }
}
