#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  long long mx = max(n, m);
  long long mn = min(n, m);
  if (k > (mn + mx - 2))
    cout << -1 << endl;
  else if (k >= mx) {
    cout << mn / ((k - (mx - 1)) + 1) << endl;
  } else {
    long long c;
    if (k >= mn)
      c = mx / ((k - (mn - 1)) + 1);
    else
      c = mx * (mn / (k + 1));
    cout << max(c, (mx / (k + 1)) * mn) << endl;
  }
  return 0;
}
