#include <bits/stdc++.h>
using namespace std;
void dfs(int long long s, int long long v[], vector<int long long> adj[],
         vector<int> &p) {
  p.push_back(s);
  v[s] = 1;
  for (int i = 0; i < adj[s].size(); i++) {
    if (v[adj[s][i]] != 1) dfs(adj[s][i], v, adj, p);
  }
}
struct cmp {
  bool operator()(
      const pair<int long long, pair<int long long, int long long>> &a,
      const pair<int long long, pair<int long long, int long long>> &b) {
    if (a.first < b.first) return true;
    if (a.first > b.first)
      return false;
    else {
      if (a.second.first > b.second.first)
        return true;
      else
        return false;
    }
  }
};
pair<int long long, int long long> fun(int long long n) {
  pair<int long long, int long long> ans;
  ans.first = INT_MAX;
  ans.second = 0;
  while (n > 0) {
    ans.first = min(n % 10, ans.first);
    ans.second = max(n % 10, ans.second);
    n /= 10;
  }
  return ans;
}
void solve() {
  int long long n, m, k, z = 1;
  cin >> n >> m >> k;
  if (k > (n - 1) + (m - 1)) {
    cout << "-1\n";
    return;
  }
  int long long ans;
  int long long a = max(n, m);
  int long long b = min(n, m);
  int long long c = k + 1;
  if (c <= a) {
    ans = max(b * (a / c), a * (b / c));
    cout << ans << "\n";
  } else {
    ans = b / (k - (a - 1) + 1);
    cout << ans << "\n";
  }
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
