#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
int gcd(int x,int y){
	return y?gcd(y,x%y):x;
}
ll F(int H,int W,int K){
	ll ans=0;
	int LIM=2*K+2*W;
	int LIM2=2*K+W+1200;
	For(k,1,W-1){
		For(d,0,H-2){
			int p1=1,p2=p1+d;
			if (p2<1) p1+=1-p2,p2=1;
			ll key=1ll*p1*(W-k)+1ll*p2*k;
			if (key>=2*K+3*W) break;
			key-=gcd(abs(d),W);
			ll b=(key>2*K?-1:max(0ll,(2*K-key)/W));
			ans+=min(H-1ll-max(p1,p2),b)+1; key+=(++b)*W;
			for (;key<=LIM&&b+p1<H&&b+p2<H;key+=W,++b){
				ll cv=key-gcd(k,b+p1)-gcd(W-k,b+p2);
				if (cv<=2*K-2) ++ans;
			}
		}
		Rep(d,-1,-H+2){
			int p1=1,p2=p1+d;
			if (p2<1) p1+=1-p2,p2=1;
			ll key=1ll*p1*(W-k)+1ll*p2*k;
			if (key>=2*K+3*W) break;
			key-=gcd(abs(d),W);
			ll b=(key>2*K?-1:max(0ll,(2*K-key)/W));
			ans+=min(H-1ll-max(p1,p2),b)+1; key+=(++b)*W;
			for (;key<=LIM&&b+p1<H&&b+p2<H;key+=W,++b){
				ll cv=key-gcd(k,b+p1)-gcd(W-k,b+p2);
				if (cv<=2*K-2) ++ans;
			}
		}
	}
	return ans*2;
}
int main(){
	int W,H,K;
	scanf("%d%d%d",&W,&H,&K);
	cout<<F(W,H,K)+F(H,W,K)<<endl;
	return 0;
}
/*
5000 5000 100000
*/