/* Robin Nittka */
#include <fstream>
#include <iostream>

using namespace std;;

#define in cin

int main()
{
	long long n, m, c;
	while (cin >> n >> m >> c && n)
	{
		if (c)
		{
			cout << (((n-6)/2) * ((m-6)/2) + ((n-7)/2) * ((m-7)/2)) << endl;
		}
		else
		{
			cout << (((n-7)/2) * ((m-6)/2) + ((n-6)/2) * ((m-7)/2)) << endl;
		}
	}
	return 0;
}
