// Arup Guha
// 6/30/2012
// Solution to 2008 Southeast Regional Problem: A Walk in the Park

import java.util.*;

class tree implements Comparable<tree> {

	public int x;
	public int y;
	public int index;

	public tree(int myx, int myy, int myindex) {
		x = myx;
		y = myy;
		index = myindex;
	}

	// Sort by x, then y.
	public int compareTo(tree other) {
		if (x != other.x) return x - other.x;
		return y - other.y;
	}

	// Reflect pt. over y=x.
	public void transpose() {
		int temp = x;
		x = y;
		y = temp;
	}

}
public class h {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		int N = stdin.nextInt();
		int M = stdin.nextInt();

		while (N != 0) {

			// Read in the forest of trees.
			tree[] forest = new tree[N];
			for (int i=0; i<N; i++) {
				int x = stdin.nextInt();
				int y = stdin.nextInt();
				forest[i] = new tree(x, y, i);
			}

			int[] tempx = new int[M];
			int[] tempy = new int[M];
			int xi = 0, yi=0;

			// Read in lines to temp arrays.
			for (int i=0; i<M; i++) {
				String s = stdin.next();

				if (s.charAt(0) == 'x') {
					tempx[xi] = Integer.parseInt(s.substring(2));
					xi++;
				}
				else {
					tempy[yi] = Integer.parseInt(s.substring(2));
					yi++;
				}
			}

			// Resize temp arrays into regular ones.
			int[] x = new int[xi];
			int[] y = new int[yi];

			for (int i=0; i<xi; i++)
				x[i] = tempx[i];
			for (int i=0; i<yi; i++)
				y[i] = tempy[i];

			System.out.println(solve(forest, x, y));

			N = stdin.nextInt();
			M = stdin.nextInt();
		}
	}

	public static int solve(tree[] forest, int[] x, int[] y) {

		// Will keep track of which trees we can see.
		boolean[] cansee = new boolean[forest.length];
		Arrays.fill(cansee, false);

		// Get ready for round 1 - trees viewed from horiz lines.
		if (y.length > 0) {
			Arrays.sort(y);
			Arrays.sort(forest);
			solveHorizontal(forest, y, cansee);
		}

		// Transpose to try to see from vertical lines.
		for (int i=0; i<forest.length; i++)
			forest[i].transpose();

		// Solve vertical lines.
		if (x.length > 0) {
			Arrays.sort(x);
			Arrays.sort(forest);
			solveHorizontal(forest, x, cansee);
		}

		// Count up all trees we can see.
		int cnt = 0;
		for (int i=0; i<cansee.length; i++)
			if (cansee[i])
				cnt++;

		return cnt;
	}

	public static void solveHorizontal(tree[] forest, int[] y, boolean[] cansee) {

		// Streak of x's in a row.
		int start = 0;
		int end = getNext(forest, start);

		while (true) {

			// Find how many lines "come before this tree" in the y list.
			int[] ranks = new int[end-start+1];
			for (int i=0; i<ranks.length; i++)
				ranks[i] = binsearch(y, forest[start+i].y);

			int len = ranks.length;

			// Here we go through each tree and see if it can be see from a horizontal line.
			for (int i=0; i<len; i++) {

				// Tricky case - we can always see this tree.
				if (len == 1) {
					cansee[forest[start].index] = true;
					break;
				}

				// This tree comes before all the lines.
				if (ranks[i] == 0) {

					// If it's the last tree or the next one isn't before the first line, we're good.
					if (i == len-1 || ranks[i+1] != 0)
						cansee[forest[start+i].index] = true;
				}

				// This tree comes in between some pair of lines.
				else if (ranks[i] > 0 && ranks[i] < y.length) {

					// If it's the first tree or the previous tree is separated by a line, we can see it.
					if (i==0 || (i > 0 && ranks[i-1] != ranks[i]))
						cansee[forest[start+i].index] = true;

					// Of if it's the last tree or the next tree is separated by a line, we can see it.
					else if (i == len-1 || (i < len-1 && ranks[i] != ranks[i+1]))
						cansee[forest[start+i].index] = true;
				}

				// This tree is past all the lines.
				else if (ranks[i] == y.length) {

					// If it's the first tree, or the previous tree has a line between it, we can see it..
					if (i==0 || ranks[i-1] != ranks[i])
						cansee[forest[start+i].index] = true;
				}
			}

			// Get out of loop if we've seen last column of trees.
			start = end+1;
			if (start == forest.length)
				break;

			// Get the end of the next streak.
			end = getNext(forest, start);
		}
	}

	public static int getNext(tree[] forest, int start) {

		// Keep on going so long as there's the same X.
		int curX = forest[start].x;
		while (start < forest.length && forest[start].x == curX) start++;

		return start-1;
	}

	// Returns how many items in values are less than val.
	public static int binsearch(int[] values, int val) {

		// Take care of edge cases.
		if (val < values[0]) return 0;
		if (val > values[values.length-1]) return values.length;

		int low = 0, high = values.length-1;

		// Binary search here.
		while (low < high) {

			int mid = (low+high)/2;
			if (val < values[mid])
				high = mid-1;
			else
				low = mid+1;
		}

		// The real answer can't be lower than the min of these two.
		int tryval = Math.min(low, high);
		while (values[tryval] < val) tryval++;
		return tryval;
	}
}