#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  if ((n - 1) + (m - 1) < k) {
    puts("-1");
    return 0;
  }
  if ((n - 1) + (m - 1) == k) {
    puts("1");
    return 0;
  }
  long long ans1 = 0, ans2 = 0;
  if ((m - 1) >= k)
    ans1 = (m / (k + 1) * n);
  else {
    ans2 = n / (k - (m - 1) + 1);
  }
  long long ans3 = 0, ans4 = 0;
  if ((n - 1) >= k) {
    ans3 = n / (k + 1) * m;
  } else {
    ans4 = m / (k - (n - 1) + 1);
  }
  cout << max(max(ans1, ans2), max(ans3, ans4)) << endl;
  return 0;
}
