fun main(args: Array<String>) {
    val (w, h, c) = readLine()!!
        .split(" ")
        .map { it.toInt() }

    // should be a > b
    fun gcd(a: Int, b: Int): Int {
        if(a < b) return gcd(b, a)
        return if (b > 0) gcd(b, a % b) else a
    }
    val gcd = gcd(w, h)
    println(w / gcd * h / gcd * c)
}
