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