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