#include<bits/stdc++.h>
using namespace std;
int GCD(int w,int h);
int r;
int main(){
    int w,h,c;
    int sum;
    cin>>w>>h>>c;
    sum=GCD(w,h);
   w=w/sum;
    h=h/sum;
    cout<<w*h*c<<"\n";
    return (0);
}
int GCD(int w,int h){
while (h!=0)
{
    r=w%h;
    w=h;
    h=r;
}
return (w);
}

