#include <bits/stdc++.h>
using namespace std;
long long a, b, c;
long long lose[40][2], ans;
int top;
int main() {
  cin >> a >> b >> c;
  long long i, j;
  if (a - 1 + b - 1 < c)
    cout << -1 << endl;
  else {
    if (a > b) a = a ^ b, b = b ^ a, a = a ^ b;
    if (c >= b - 1) {
      if (ans < a / (c - b + 2)) ans = a / (c - b + 2);
    } else if (ans < a * (b / (c + 1)))
      ans = a * (b / (c + 1));
    if (c >= a - 1) {
      if (ans < b / (c - a + 2)) ans = b / (c - a + 2);
    } else if (ans < b * (a / (c + 1)))
      ans = b * (a / (c + 1));
    cout << ans << endl;
  }
  return 0;
}
