#include<stdio.h>
int main(void)
{
	int w,h,c,a,b,x;
	scanf("%d %d %d",&w,&h,&c);
	a=w;	b=h;
	if(a<b){
		x=a;
		a=b;
		b=x;
	}
	x=a%b;
	while(x!=0){
		a=b;
		b=x;
		x=a%b;
	}
	w=w/b;
	h=h/b;
	x=w*h;
	c=c*x;
	printf("%d\n",c);
	return 0;
}