#include<iostream>     
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
int H,W,K;
ll Ans=0;

int gcd(int a,int b){
	if(!b)return a;
	return gcd(b,a%b);
}

inline void solve(){
	for(int s=0;s<=min(H-2,2*K+W-2);++s)
	    for(int x=1;x<W&&x*s<=2*K+W-2;++x){
	    	int R=2*K+gcd(s,W)-s*x-2;
	    	int tmp=min(R/W,H-s-1);
	    	if(tmp>0){
	    		if(s==0)Ans+=2ll*tmp;
	    		else Ans+=4ll*tmp;
			}
	    	int yy=(R/W)+1;
	    	if(yy>=H-s)continue;
	    	if(1ll*W*yy-gcd(x,yy)-gcd(W-x,yy+s)<=R){
	    		if(s==0)Ans+=2;
	    		else Ans+=4;
			}
		}
}

inline void rd(int &x){
	x=0;char ch=getchar();
	while(ch>='0'&&ch<='9'){
		x=x*10+ch-'0';
		ch=getchar();
	}
}

int main(){
	rd(W);rd(H);rd(K);
	solve();
	swap(W,H);
	solve();
	printf("%lld\n",Ans);
	return 0;
}