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