import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int h = sc.nextInt(); int w = sc.nextInt(); int n = sc.nextInt(); int m = sc.nextInt(); int[] tops = new int[n]; int[] unders = new int[n]; int[] lefts = new int[n]; int[] rights = new int[n]; int[] lives = new int[n]; for (int i = 0; i < n; i++) { tops[i] = sc.nextInt(); unders[i] = sc.nextInt(); lefts[i] = sc.nextInt(); rights[i] = sc.nextInt(); lives[i] = sc.nextInt(); } long[][] field = new long[h + 2][w + 2]; for (int i = 0; i < m; i++) { int row = sc.nextInt(); int col = sc.nextInt(); int b = sc.nextInt(); int power = sc.nextInt(); int startR = Math.max(1, row - b); int startC = Math.max(1, col - b); int endR = Math.min(h, row + b); int endC = Math.min(w, col + b); field[startR][startC] += power; field[endR + 1][startC] -= power; field[startR][endC + 1] -= power; field[endR + 1][endC + 1] += power; } for (int i = 1; i <= h; i++) { for (int j = 1; j <= w; j++) { field[i][j] += field[i - 1][j] + field[i][j - 1] - field[i - 1][j - 1]; } } for (int i = 1; i <= h; i++) { for (int j = 1; j <= w; j++) { field[i][j] += field[i - 1][j] + field[i][j - 1] - field[i - 1][j - 1]; } } int count = 0; for (int i = 0; i < n; i++) { long total = field[unders[i]][rights[i]] - field[tops[i] - 1][rights[i]] - field[unders[i]][lefts[i] - 1] + field[tops[i] - 1][lefts[i] - 1]; if (total < lives[i]) { count++; } } System.out.println(count); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }