#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  if (k > n + m - 2)
    printf("-1\n");
  else {
    long long ans = 0;
    if (k > n - 1)
      ans = max(ans, m / (k - (n - 1) + 1));
    else
      ans = max(ans, m * (n / (k + 1)));
    swap(n, m);
    if (k > n - 1)
      ans = max(ans, m / (k - (n - 1) + 1));
    else
      ans = max(ans, m * (n / (k + 1)));
    printf("%lld\n", ans);
  }
  return 0;
}
