from collections import * from itertools import * from functools import * from heapq import * import sys,math input = sys.stdin.readline H,W,N,M = map(int,input().split()) class cs_2d(): def __init__(self,x): n = len(x) m = len(x[0]) tmp = [[0]*(m+1) for _ in range(n+1)] for i in range(n): tmp[i+1][1:] = x[i] for j in range(m): tmp[i+1][j+1] += tmp[i+1][j] for j in range(m): for i in range(n): tmp[i+1][j+1] += tmp[i][j+1] self.S = tmp def query(self,ix,jx,iy,jy): ##[ix,jx)×[iy,jy) T = self.S return T[jx][jy] - T[jx][iy] - T[ix][jy] + T[ix][iy] X = [[0]*(W+2) for _ in range(H+2)] G = [tuple(map(int,input().split())) for _ in range(N)] fx = lambda x : min(max(0,x),H+1) fy = lambda x : min(max(0,x),W+1) for _ in range(M): x,y,b,c = map(int,input().split()) X[fx(x-b)][fy(y-b)] += c X[fx(x+b+1)][fy(y+b+1)] += c X[fx(x-b)][fy(y+b+1)] -= c X[fx(x+b+1)][fy(y-b)] -= c TX = cs_2d(X).S for i in range(H+2): TX[i][W+1]=0 for i in range(W+2): TX[H+1][i]=0 SX = cs_2d(TX) ans = N for t,u,l,r,a in G: if SX.query(fx(t),fx(u)+1,fy(l),fy(r)+1)>=a: ans -= 1 print(ans)