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