h,w,n,m = map(int,input().split()) dp = [[0]*(w+1) for i in range(h+1)] S = [tuple(map(int,input().split())) for i in range(n)] for i in range(m): x,y,b,c = map(int,input().split()) dp[max(x-b,1)][max(y-b,1)] += c if x+b+1 <= h and y+b+1 <= w: dp[x+b+1][y+b+1] += c if x+b+1 <= h: dp[x+b+1][max(y-b,1)] -= c if y+b+1 <= w: dp[max(x-b,1)][y+b+1] -= c for i in range(1,h+1): for j in range(w): dp[i][j+1] += dp[i][j] for i in range(1,w+1): for j in range(h): dp[j+1][i] += dp[j][i] for i in range(1,h+1): for j in range(1,w+1): dp[i][j] += dp[i][j-1]+dp[i-1][j]-dp[i-1][j-1] ans = 0 for t,u,l,r,a in S: if dp[u][r]-dp[u][l-1]-dp[t-1][r]+dp[t-1][l-1] < a: ans += 1 print(ans)