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