fun main(args : Array<String>) {
    (1..2).map { readLine() }.map { requireNotNull(it) }.let {
        val result= WhiteCells().exec(*it.toTypedArray())
        println(result)
    }
}

class WhiteCells {
    fun exec(vararg args : String) : String{
        // 1 =< hw =< 20
        val HW = args[0].split(" ").let {
            Pair(it[0].toInt(), it[1].toInt())
        }

        // 1 =< h < H 1 =<w =< W
        val hw = args[1].split(" ").let {
            Pair(it[0].toInt(), it[1].toInt())
        }

        val table = Table(HW.first, HW.second)

        table.selectRow(hw.first)

        table.selectColumn(hw.second)

        return "${table.getWhiteCount()}"
    }

    class Table(
        height : Int,
        width : Int
    ) {
        val rows : List<Row> = (1..height).map { Row(width) }

        fun selectRow(num : Int) {
            (1..num).forEach {position ->
                rows[position-1].cells.forEach { it.isBlack = true }
            }
        }

        fun selectColumn(num :Int) {
            (1..num).forEach {col ->
                rows.forEach {
                    it.cells[col-1].isBlack = true
                }
            }
        }

        fun getWhiteCount() : Int {
            return rows.flatMap { it.cells }.count { !it.isBlack }
        }
    }

    class Row(
        width: Int
    ) {
        val cells : List<Cell> = (1..width).map { Cell() }
    }

    class Cell(var isBlack : Boolean = false)
}