object Main extends App {
  import scala.io.StdIn._

  val Array(h, w) = readLine.trim.split(' ').map(_.toInt)
  val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
  println(
    h * w - (h - (h % a)) * (w - (w % b))
  )
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline
    def let[A](func: T ⇒ A): A = func(value)
  }
}
