Archaeologists at a dig divide the area they are examining into a grid and record which grid cell each item is found in. This makes it easy to tell how many items were found in a given cell.
For each scenario you are given the coordinates of the cells where items were found. For a list of query cells, determine the total number of items contained in those cells.
The input consists of several scenarios.
The first line of each scenario contains two integers $X$ and $Y$, separated by a space, representing the length and width of the grid ($0 < X, Y \le 100$). A scenario in which $X$ and $Y$ are both $0$ marks the end of input.
The second line contains a single integer $M$, the number of items located by the archaeologists ($0 < M \le 10000$). This is followed by $M$ lines, each containing the $X$ and $Y$ coordinates of the cell in which an item was found. The grid coordinate system starts at $0, 0$, and several items may be found in a single cell, so cell coordinates may be repeated.
After the $M$ item locations comes a list of cells for which the total number of found items is required. The first line of this section is a single integer $N$, the number of cells ($0 < N \le X \times Y$). It is followed by $N$ lines, each containing the $X$ and $Y$ coordinates of a cell.
Output a single line for each scenario. Each line contains the total number of items found in the $N$ listed cells.
In the example, cell $(9, 9)$ contains $2$ items (it appears twice in the input list), cell $(4, 5)$ contains $1$, and cell $(6, 3)$ contains none (it does not occur in the input list). The total is therefore $2 + 1 + 0 = 3$.