#include <bits/stdc++.h>
long long min(long long x, long long y) {
  if (x < y) return x;
  return y;
}
long long fun(long long n, long long m, long long k) {
  if (k <= 0) return n * m;
  long long max = (n > m) ? n : m;
  long long res1 = 0, res2 = 0;
  if (n % (k + 1) == 0) res1 = m * (n / (k + 1));
  if (m % (k + 1) == 0) res2 = n * (m / (k + 1));
  if (res1 && res2) {
    if (res1 > res2) return res1;
    return res2;
  } else if (res1)
    return res1;
  else if (res2)
    return res2;
  if (k >= max) {
    res1 = min(fun(n, m, n - 1), fun(1, m, k - n + 1));
    res2 = min(fun(n, m, m - 1), fun(n, 1, k - m + 1));
    if (res1 > res2) return res1;
    return res2;
  } else {
    res1 = m * (n / (k + 1));
    res2 = n * (m / (k + 1));
    if (res1 > res2) return res1;
    return res2;
  }
}
int main() {
  long long n, m, k;
  scanf("%lld%lld%lld", &n, &m, &k);
  if (n + m - 2 < k) {
    printf("-1\n");
    return 0;
  }
  if (n > m)
    printf("%lld\n", fun(n, m, k));
  else
    printf("%lld\n", fun(m, n, k));
  return 0;
}
