#include <bits/stdc++.h>
#pragma comment(linker, "/stack:336777216")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ui = unsigned int;
ll const mod = 1e9 + 7;
auto mt = mt19937(chrono::steady_clock::now().time_since_epoch().count());
ll solve(ll n, ll m, ll k) {
  if (k <= m - 1) {
    ll avg = m / (k + 1);
    return avg * n;
  } else if (k <= n - 1) {
    ll avg = n / (k + 1);
    return avg * m;
  } else {
    ll cuts_left = k - (n - 1);
    ll avg = m / (cuts_left + 1);
    return avg;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  ll n, m, k;
  cin >> n >> m >> k;
  if (n + m - 2 < k) return cout << -1 << '\n', 0;
  if (n + m - 2 == k) return cout << 1 << '\n', 0;
  cout << max(solve(n, m, k), solve(m, n, k)) << '\n';
  return 0;
}
