/* Manfred Sauter */
#include <cmath>
#include <iostream>
#include <fstream>
using namespace std;

typedef long long llong;

#define in cin

llong calc_good(llong m, llong n)
{
	if (m < 8 || n < 8) return 0;
	llong res = ((m - 8)/2+1) * ((n-8)/2+1);
	return res;
}

int main()
{
	llong n,m,c;
	while (in >> n >> m >> c)
	{
		if (!n && !m && !c) break;


		llong res = 0;
		if (c == 1)
		{
			res = calc_good(m, n) + calc_good(m-1, n-1);
		}
		else
		{
			res = calc_good(m-1, n) + calc_good(m-2, n-1);
			if (n-1 >= 8) res += (n-1-8)/2 + 1;
		}


		cout << res << endl;
	}


	return 0;
}

