#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll W, H, C;
    cin >> W >> H >> C;
    ll s = W * H;
    ll ans = W * H * C;
    for (ll i = 2; i <= min(W, H); i++) {
        ll t = i * i;
        if (t > s) break;
        if (W % i == 0 && H % i == 0) {
            ans = W / i * H / i * C;
        }
    }
    cout << ans << "\n";
    return 0;
}
