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