object Main extends App {
  val Array(w, h, cost) = io.Source.stdin.getLines.flatMap(_.split(" ")).map(_.toInt).toArray

  def gcd(num: Int, reminder: Int): Int = {
    if (num % reminder == 0) reminder else gcd(reminder, num % reminder)
  }

  val gCD = gcd(w, h)
  println((w/gCD) * (h/gCD) * cost)
}

