#include <bits/stdc++.h>
using namespace std;
using namespace std::rel_ops;
template <class A>
inline bool Max(A& a, const A& b) {
  return a < b ? a = b, true : false;
}
template <class A>
inline bool Min(A& a, const A& b) {
  return b < a ? a = b, true : false;
}
template <class A, class B>
ostream& operator<<(ostream& out, const pair<A, B>& p) {
  return out << '[' << p.first << ',' << p.second << ']';
}
template <class It>
ostream& output(ostream& out, It first, It last) {
  if (first == last) return out << "[]";
  out << '[' << *first;
  while (++first != last) {
    out << ',' << *first;
  }
  return out << ']';
}
template <class A>
ostream& operator<<(ostream& out, const vector<A>& v) {
  return output(out, v.begin(), v.end());
}
template <class A>
ostream& operator<<(ostream& out, const set<A>& st) {
  return output(out, st.begin(), st.end());
}
template <class A>
ostream& operator<<(ostream& out, const multiset<A>& st) {
  return output(out, st.begin(), st.end());
}
int readInt() {
  int ch;
  while (!isdigit(ch = getchar()) && ch != '-')
    if (ch == -1) return -1;
  bool neg = false;
  int x;
  if (ch == '-')
    neg = true;
  else
    x = ch - '0';
  while (isdigit(ch = getchar())) x = (x << 3) + (x << 1) + ch - '0';
  return neg ? -x : x;
}
long long solve(long long a, long long b, long long c) {
  if (a + b - 2 < c) return -1;
  if (a == c + 1) return b;
  if (a > c + 1) {
    ;
    ;
    long long tt = a / (c + 1);
    ;
    ;
    return tt * b;
  } else {
    c = c - a + 1;
    ;
    return b / (c + 1);
  }
}
int main(int argc, char** argv) {
  int a, b, c;
  while (cin >> a >> b >> c) {
    long long x = solve(a, b, c);
    long long y = solve(b, a, c);
    cout << max(x, y) << endl;
  }
  return EXIT_SUCCESS;
}
