#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
	int w,h,c,t,r,a,b;
	cin>>w>>h>>c;
	if(w>h)
	{
		a=w;
		b=h;
	}
	else
	{
		a=h;
		b=w;
	}
	while((r=a%b)!=0)
	{
		a=b;
		b=r;	
	}
	cout<<(w/b)*(h/b)*c<<endl;
	return 0;
}
