{-# LANGUAGE OverloadedStrings #-}

import qualified Data.ByteString.Char8 as B
import Data.Attoparsec.ByteString.Char8

type Input  = (Int, Int, Int, Int)
type Output = Int

input :: Parser Input
input = do
  (_H, _W) <- decimalPair
  (_h, _w) <- decimalPair
  return (_H, _W, _h, _w)

decimalPair :: Parser (Int, Int)
decimalPair = (,) <$> decimal <* space <*> decimal <* endOfLine

main :: IO ()
main = B.interact
  $ B.pack . show . either (error "parse err") solve . parseOnly input

solve :: Input -> Output
solve (_H, _W, _h, _w) = (_H - _h) * (_W - _w)