#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
int main(void) {
  cin >> n >> m >> k;
  if (n + m < k + 2)
    cout << "-1\n";
  else {
    long long resp = 0;
    if (n < m) swap(n, m);
    if (n > k)
      resp = n / (k + 1) * m;
    else
      resp = m / (k - n + 2);
    swap(n, m);
    long long resp1 = 0;
    if (n > k)
      resp1 = n / (k + 1) * m;
    else
      resp1 = m / (k - n + 2);
    cout << max(resp, resp1) << endl;
  }
  return 0;
}
