#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m, k;
int main() {
  int t, x, y, z, ca = 1;
  scanf("%d%d%d", &(n), &(m), &(k));
  if (n - 1 + m - 1 < k)
    puts("-1");
  else {
    long long re = 0;
    if (n - 1 >= k) re = max(re, 1ll * n / (k + 1) * m);
    if (m - 1 >= k) re = max(re, 1ll * m / (k + 1) * n);
    if (n - 1 < k) re = max(re, 1ll * m / (k - (n - 1) + 1));
    if (m - 1 < k) re = max(re, 1ll * n / (k - (m - 1) + 1));
    printf("%I64d\n", (re));
  }
  return 0;
}
