#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

inline int topbit(unsigned long long x){
	return x?63-__builtin_clzll(x):-1;
}

inline int popcount(unsigned long long x){
	return __builtin_popcountll(x);
}

inline int parity(unsigned long long x){
	return __builtin_parity(x);
}

int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}

int solve(int W,int H,int K){
	vector<int>gcd_Wv(H);
	for(int i=0;i<H;i++)gcd_Wv[i]=gcd(W,i);
	const int L=2*K+2*W-2;
	int ans=0;
	for(int y=1;y<W;y++){
		for(int x=1;x*W<=L&&x<H;x++){
			int gcd_xy=gcd(x,y);
			int s;
			int tmp=2*K+gcd_xy-2-(W-y)*x;
			if(tmp<=0)s=1;
			else s=tmp/y+1;
			chmax(s,x);
			chmin(s,H-1);
			ans+=s-x;
			for(int z=s;(W-y)*x+y*z<=2*K+gcd_xy+W-y+W-2&&z<H;z++){
				int num=(W-y)*x+y*z+2;
				num-=gcd_xy+gcd_Wv[z-x]+gcd(W-y,z);
				num/=2;
				if(num<=K)ans++;
			}
		}
	}

	ans*=2;
	for(int y=1;y<W;y++){
		for(int x=1;x*W<=L&&x<H;x++){
			int num=x*W+2;
			num-=gcd(x,y)+gcd(W-y,x)+W;
			num/=2;
			if(num<=K)ans--;
		}
	}
	
	ans*=2;
	return ans;
}

signed main(){
	int W,H,K;
	cin>>W>>H>>K;
	cout<<solve(W,H,K)+solve(H,W,K)<<endl;
	return 0;
}
