#include <bits/stdc++.h>
using namespace std;
long double eps = (long double)1 / 1e6;
long long inf_ll = 1e18, mod1 = 1e9 + 7, mod2 = 998244353;
template <typename T>
T sqr(T a) {
  return a * a;
}
template <typename T>
T qb(T a) {
  return a * a * a;
}
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
long long binpow(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod
                    : sqr(binpow(a, b / 2, mod)) % mod)
           : 1;
}
long long binmult(long long a, long long b, long long mod) {
  return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod
                    : (2 * binmult(a, b / 2, mod)) % mod)
           : 0;
}
int main() {
  cout.tie(0), cin.tie(0), ios_base::sync_with_stdio(0);
  long long n, m, k, tk, ans = 0;
  cin >> n >> m >> k;
  if (k > n - 1 + m - 1) cout << -1, exit(0);
  tk = k;
  if (tk <= m - 1) {
    ans = max(ans, n * ((n * m) / (n * (tk + 1))));
  } else {
    tk -= m - 1;
    ans = max(ans, n / (tk + 1));
  }
  tk = k;
  if (tk <= n - 1) {
    ans = max(ans, m * ((n * m) / (m * (tk + 1))));
  } else {
    tk -= n - 1;
    ans = max(ans, m / (tk + 1));
  }
  cout << ans;
  return 0;
}
