You are given a table with R rows and C columns. Each cell contains one lowercase English letter, and every cell is a square of the same size.
Coordinates are assigned to the vertices of the cells. The upper-left corner of the table is (0, 0), the upper-right corner is (C, 0), the lower-left corner is (0, R), and the lower-right corner is (C, R).
A polygon inside the table is called monoliteral if it satisfies all of the following conditions.
You are given one simple polygon satisfying conditions 1 and 2. You may translate it by an integer distance upward, downward, leftward, rightward, or by a combination of those directions, but you may not rotate it. Count the number of distinct positions where the translated polygon lies completely inside the table and is monoliteral.
The first line contains two space-separated integers R and C. (1 <= R, C <= 500)
Each of the next R lines contains a lowercase English string of length C, describing one row of the table.
The next line contains the number of vertices V of the given polygon. (4 <= V <= 500)
Each of the next V lines contains two integers X and Y, the coordinates of a vertex. (0 <= X <= C, 0 <= Y <= R)
The vertices are given in clockwise order. The given polygon satisfies conditions 1 and 2 from the statement.
Print the number of polygon positions that satisfy the condition.