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

    val grid = Array(h) { BooleanArray(w) { true } }

    (0 until h1).forEach { i ->
        (0 until w).forEach { j ->
            grid[i][j] = false
        }
    }

    (0 until w1).forEach { i ->
        (0 until h).forEach { j ->
            grid[j][i] = false
        }
    }

    println(grid.map { it.filter { b -> b }.count() }.sum())
}
