#include<cstdio>
using namespace std;
int n,m,k;
long long gcd(int x,int y)
{
	if (y==0) return x;
	return gcd(y,x%y);
}
void swap(long long &x,long long &y)
{
	long long t=x;x=y;y=t;
}
long long calculate(int r,int c)
{
	long long total=0;
	int pnum=0; 
	for (long long x=1;x<r;x++)
	{
		if (x*c>2*k-1+c*3) break;
		for (long long y=1;y<c;y++)
		{
			int start=x+1;
			long long s=2*k-1-(x*c-x*y-gcd(x,y));
			start=s/y-1;
			if (start<=x) start=x+1;
			if (start>=r) start=r-1;
			if (r<=x+1) continue;
			total+=(start-x-1);
		//	start=x+1;
			for (long long z=start;z<r;z++)
			{
				long long p=z*y-gcd(c-y,z)-gcd(z-x,c);
				if (x*c+z*y-x*y>2*k-1+c*3) break;
				if (p<=s) total++;
			}
			pnum++;
		//	printf("%d\n",total);
			if (pnum==9)
			{
				total++;total--;
			}
		}
	}
	total*=2;
	for (long long x=1;x<r;x++)
	{
		if (x*c>2*k-1+c*3) break;
		for (long long y=1;y<c;y++)
		{
			long long z=x;
			long long p=x*c+z*y-x*y-gcd(x,y)-gcd(c-y,z)-gcd(z-x,c);
			if (p<=2*k-1) total++;
		}
	}
	return total*2;
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	//n++;m++;
	long long ans=0;
	ans=calculate(n,m);
	ans=ans+calculate(m,n);
	printf("%lld\n",ans);
}
