You are responsible for inspecting the trees in a park to keep them healthy. Each tree's location is an integer point in the two-dimensional plane. Because the grass was recently replanted, you may only move along a set of paths. Each path is an infinite horizontal or vertical line in the plane.
You want to know how many trees can be seen from the paths. You may view a tree only by standing at some point on a path and facing perpendicular to that path: from a vertical path you look horizontally, and from a horizontal path you look vertically. A tree is visible if, looking in that direction, no other tree lies strictly between you and it.
Count the number of trees that are visible from at least one path.
The input describes a single park configuration in the following form:
NTREES NPATHS
X(1) Y(1)
.
.
.
X(NTREES) Y(NTREES)
PATH(1)
.
.
.
PATH(NPATHS)
NTREES and NPATHS are integers in the range $[1, 100000]$. The next NTREES lines give the integer coordinates of the trees. They are followed by NPATHS lines, each of the form x=C or y=C, describing a vertical or horizontal path, where C is an integer in the range $[-1000000, 1000000]$.
All coordinates are in the range $[-1000000, 1000000]$. All trees are distinct, no tree lies on any path, and all paths are distinct.
Print a single integer: the number of trees that are visible from at least one path.