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