#include <bits/stdc++.h>
using namespace std;
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
const int infi = 1e9;
const long long Linfi = (long long)9e18;
const long long MOD = 1000000007;
long long n, m, k, a, b, c;
void solve() {
  a = n, b = m, c = k;
  long long maxx = n + m - 2;
  if (k > maxx) {
    cout << -1 << endl;
    return;
  }
  long long ans = 0;
  if (k < n) {
    long long tmp = n / (k + 1);
    tmp *= m;
    ans = tmp;
    tmp = m / (k + 1);
    tmp *= n;
    ans = max(ans, tmp);
  } else if (k >= n && k < m) {
    long long tmp = m / (k + 1);
    tmp *= n;
    ans = tmp;
  } else if (k >= m) {
    long long tmp = n / (k - m + 2);
    long long tmp2 = m / (k - n + 2);
    ans = max(tmp, tmp2);
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  if (n > m) swap(n, m);
  solve();
  return 0;
}
