Time limit
2s
Memory limit
128 MB
Minsik Corporation received an urgent request from the International Ice Hockey Federation (IIHF). They needed a system that sounds an alarm when too many players from the same team are on the rink. The system works in three steps.
The hockey rink is the union of a central rectangle and two circular end regions. The rectangle has lower-left corner (X, Y) and size W * H. Let r = H / 2. The left circle has center (X, Y + r), the right circle has center (X + W, Y + r), and both circles have radius r.
Given the players' coordinates, determine how many players are inside the rink or on its boundary.

The first line contains integers W H X Y P. P is the number of players.
W and H are positive integers at most 100, and H is even. X and Y are integers whose absolute values are at most 100. P is a positive integer at most 50.
Each of the next P lines contains one player's coordinates x y. The absolute value of each coordinate is at most 300.
Print the number of players who are inside the rink or on its boundary.