#include <bits/stdc++.h>
long long int n, m, k;
long long int p1, p2, p3, p4;
int main() {
  scanf("%lld%lld%lld", &n, &m, &k);
  if (k > m + n - 2) {
    printf("-1\n");
    return 0;
  }
  if (m > n) std::swap(m, n);
  long long int q = k;
  long long int p1_, p2_;
  if (k < n) {
    long long int kol = n / (k + 1);
    p1 = kol * m;
  } else {
    k -= n - 1;
    p2 = m / (k + 1);
  }
  p1_ = std::max(p1, p2);
  std::swap(m, n);
  k = q;
  if (k < n) {
    long long int kol = n / (k + 1);
    p3 = kol * m;
  } else {
    k -= n - 1;
    p4 = m / (k + 1);
  }
  p2_ = std::max(p4, p3);
  printf("%lld\n", std::max(p1_, p2_));
}
