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