program aaa
implicit none

integer :: h, w, x, y, i, res
integer,allocatable,dimension(:,:) :: a

read*, h, w
allocate(a(h,w))
read*, x, y

a=0
res=0

do i=1,x
a(i,:)=1
end do
do i=1,y
a(:,i)=1
end do

write(*,'(i0)') h*w-sum(a)

end program