#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int MAXN = 1000000;
const int logn = 12;
const int inf = 2e9;
const int alpha = 26;
const int my_hash = 31;
const long long base = 1000000000;
const long long my_mod = 2674894331;
const long long l_inf = 4e18;
const long long mod = 1000000007;
const double pi = acos(-1.0);
const double eps = 1e-10;
int main() {
  int n, m, k;
  long long ans = 0;
  scanf("%d %d %d", &n, &m, &k);
  if (k > n + m - 2) {
    printf("-1");
    exit(0);
  }
  if (n > m) swap(n, m);
  if (k < n)
    printf("%I64d", max(n * 1ll * (m / (k + 1)), m * 1ll * (n / (k + 1))));
  else if (k < m)
    printf("%I64d", n * 1ll * (m / (k + 1)));
  else
    printf("%I64d", n / 1ll / (k - (m - 1) + 1));
}
