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