#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  long long x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x;
}
const long long MOD = 1e9 + 7;
long long mod(const long long x) { return (((x % MOD) + MOD) % MOD); }
struct mat {
  long long data[2][2];
  mat(bool m = 0) {
    memset(data, 0, sizeof(data));
    if (m) {
      for (int i = 0; i < 2; i++) {
        data[i][i] = 1;
      }
    }
  }
  friend mat operator*(const mat& x, const mat& y) {
    mat c(0);
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 2; k++) {
          c.data[i][j] = mod(c.data[i][j] + x.data[i][k] * y.data[k][j]);
        }
      }
    }
    return c;
  }
};
signed main() {
  long long n = in(), m = in(), k = in();
  if (n < m) swap(n, m);
  if (k > n + m - 2) {
    puts("-1");
    return 0;
  }
  long long ans = -1;
  if (n - 1 >= k) ans = max(ans, (n - n % (k + 1)) / (k + 1) * m);
  if (m - 1 >= k) ans = max(ans, (m - m % (k + 1)) / (k + 1) * n);
  if (!(n - 1 >= k || m - 1 >= k))
    ans = max(ans, (m - m % (k - n + 2)) / (k - n + 2));
  printf("%I64d\n", ans);
  return 0;
}
