main = interact $ unlines . map (show . persimmon) . read' . lines
 where
  read' ("0":_) = []
  read' (n:wh:xs) = (read n, (w,h), (s,t), map (map read . words) ps) : read' xs'
   where
    [w,h] = map read (words wh)
    [s,t] = map read (words st)
    (ps,(st:xs')) = splitAt (read n) xs

persimmon :: (Int, (Int,Int), (Int,Int), [[Int]]) -> Int
persimmon (n,(w,h),(s,t),ps)
 | s*t == 1 || n == 1 = 1
 | otherwise = maximum (map countTree estate)
 where
  estate = [((x1,y1),(x2,y2)) | x1<-[1..w-s+1], y1<-[1..h-t+1], let (x2,y2)=(x1+s-1,y1+t-1)]
  countTree ((x1,y1),(x2,y2)) = length $ filter (\[px,py] -> elem px [x1..x2] && elem py [y1..y2]) ps