#include <bits/stdc++.h>
#define pi acos(-1)
#define fastcin cin.tie(NULL);ios_base::sync_with_stdio(false);
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
const int INF = 0x3f3f3f3f;
const LL ll_INF = 0x3f3f3f3f3f3f3f3f;
const int MAXN =1000000 + 10;
const LL mod = 1e9+7;
int main()
{
fastcin;
LL n, m, k;
cin >> n >> m >> k;
if(k>(n+m-2)){ cout << "-1" << endl; return 0; }
if(k<max(n, m)) cout<< max(n*(m/(k+1)), m*(n/(k+1))) << endl;
else cout << max(n/(k-m+2), m/(k-n+2)) << endl;
}