/*
不确定题目的运行时间,但是全部取最大值没法在1s内跑完。
*/
#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, m, k;
int f[60][60][60];
int dfs(int n, int m, int k)
{
if (n * m == k || k == 0) return f[n][m][k] = 0;
if (n * m < k) return f[n][m][k] = inf / 2;
if (f[n][m][k] != inf) return f[m][n][k] = f[n][m][k]; // 对称记忆,速度快一倍
int &res = f[n][m][k];
for (int i = 1, j; i <= n + m - 2; i ++ )
{
int A, B, ia, ib;
if (i >= 1 && i <= n - 1) j = m, ia = i, ib = n - ia;
else j = n, ia = i - n + 1, ib = m - ia;
A = min(ia * j, ib * j);
B = max(ia * j, ib * j);
for (int K = 0; K <= k; K ++ )
{
// cout << "A: " << A / j << ' ' << j << ' ' << K << ' ';
// cout << "B: " << B / j << ' ' << j << ' ' << k - K << ' ' << endl;
res = min(dfs(ia, j, K) + dfs(ib, j, k - K) + j * j, res);
}
}
return res;
}
int main()
{
memset(f, 0x3f, sizeof f);
cin >> n >> m >> k;
cout << dfs(n, m, k) << endl;
return 0;
}