public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			m = sc.nextInt();
			if(m==0)break;
			n = sc.nextInt();
			s = sc.nextInt();
			int[][][] a = new int[s][m+1][n+1];
			for(int i=0;i<s;i++)a[i]=bfs(sc.nextInt(), sc.nextInt());
			int max = 0;
			int t = sc.nextInt();
			while(t--!=0){
				int[][] r = bfs(sc.nextInt(), sc.nextInt());
				int c = 0;
				for(int x=1;x<=m;x++){
					for(int y=1;y<=n;y++){
						boolean f = true;
						for(int k=0;k<s;k++){
							if(r[x][y]>=a[k][x][y])f=false;
						}
						if(f)c++;
					}
				}
				max = Math.max(max, c);
			}
			System.out.println(max);
		}
	}