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