#include <bits/stdc++.h>
using namespace std;
const long long Nmax = 40000;
inline long long func(long long x, long long y) {
  if (y <= 0) return x;
  y++;
  if (y > x) return -1;
  return x / y;
}
int main(void) {
  long long n, m, k, p;
  long long rez = 0;
  cin >> n >> m >> k;
  if (n + m - 2 < k) {
    printf("-1");
    return 0;
  }
  if (n - 1 > k)
    rez = max(rez, (n / (k + 1)) * m);
  else
    rez = max(rez, m / (k - n + 1 + 1));
  if (m - 1 > k)
    rez = max(rez, (m / (k + 1)) * n);
  else
    rez = max(rez, n / (k - m + 1 + 1));
  cout << rez;
}
