#include <bits/stdc++.h>
struct debugger {
  template <typename T>
  debugger operator,(const T& v) {
    std::cout << v << " ";
    return (*this);
  }
} dbg;
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  long long m, n, k;
  cin >> m >> n >> k;
  long long ans = 0;
  if (k < max(m, n)) {
    ans = max(m * (n / (k + 1)), n * (m / (k + 1)));
  } else if (k <= m + n - 2) {
    ans = max(n / (k - m + 2), m / (k - n + 2));
  } else
    ans = -1;
  cout << ans << endl;
}
