#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, m, k, res;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  if (n > m) swap(n, m);
  if (k < n) {
    res = max(n * (m / (k + 1)), (n / (k + 1)) * m);
  } else if (n <= k && k < m) {
    res = n * (m / (k + 1));
  } else if (m <= k && k <= m + n - 2) {
    res = n / (k + 2 - m);
  } else
    res = -1;
  cout << res;
  return 0;
}
