program caddi2018b
  implicit none
  integer n, h, w
  integer, dimension(:,:), allocatable :: a

  read *, n, h, w
  allocate(a(2,n))
  read *, a
  print '(i0)', count(a(1,:) >= h .and. a(2,:) >= w)
end program caddi2018b
