#include <bits/stdc++.h>
using namespace std;
long long n, m, k, ans;
int main() {
  cin >> n >> m >> k;
  if (k > m + n - 2) return cout << -1, 0;
  ans = max((k < n ? m * (n / (k + 1)) : m / (k - n + 2)),
            (k < m ? n * (m / (k + 1)) : n / (k - m + 2)));
  return cout << ans, 0;
}
