program main
  implicit none
  integer :: H,M
  integer :: hs,ws
  integer,allocatable :: mass(:,:)
  integer :: i
  read(*,*) H,M
  read(*,*) hs,ws
  allocate(mass(H,M))

  mass = 1
  do i = 1,hs
     mass(i,:) = 0
  end do
  do i = 1,ws
     mass(:,i) = 0
  end do

  write(*,'(i0)')sum(mass)

  stop
end program main
