#include <cstdio>
#include <algorithm>
using namespace std;

int gcd(int a, int b) {
    while (a % b!= 0) {
        int tmp = b;
        b = a % b;
        a = tmp;
    }
    return b;
}

int main()
{
    int w, h, c, gd, area;
    scanf("%d %d %d", &w, &h, &c);
    if (h > w) swap(h, w);
    gd = gcd(w, h); gd *= gd;
    area = h * w;
    printf("%d\n", area/gd * c);

    return 0;
}

