#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void umin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <class T>
inline T gcd(T a, T b) {
  return __gcd(a, b);
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
const int inf = 1e9 + 143;
const long long longinf = 1e18 + 143;
inline int read() {
  int x;
  scanf(" %d", &x);
  return x;
}
int main() {
  int n = read();
  int m = read();
  int k = read();
  if (n + m - 2 < k) {
    puts("-1");
    return 0;
  }
  long long ans = 0LL;
  if (m - 1 >= k) umax(ans, (long long)n * (m / (k + 1)));
  swap(n, m);
  if (m - 1 >= k) umax(ans, (long long)n * (m / (k + 1)));
  if (k - (m - 1) + 1 != 0) umax(ans, 0LL + n / (k - (m - 1) + 1));
  if (k - (n - 1) + 1 != 0) umax(ans, 0LL + m / (k - (n - 1) + 1));
  cout << ans << endl;
  return 0;
}
