#include<cstdio>
#include<iostream>
using namespace std;
int main(void){
	long long int w,h,c,i,wh,m,min;
	cin>>w>>h>>c;
	wh=w*h;
	min=9223372036854775807;
	for(i=1;i*i<=wh;i++){
		if(wh%(i*i)==0&&w%i==0&&h%i==0){
			m=(wh/(i*i))*c;
			if(min>m) min=m;
		}
	}
	cout<<min<<endl;
	return 0;
}