mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline H, W, N, M = map(int, input().split()) slime_info = [] for _ in range(N): slime_info.append(tuple(map(int, input().split()))) imos = [[0] * (W+1) for _ in range(H+1)] for _ in range(M): h, w, b, c = map(int, input().split()) h -= 1 w -= 1 h0 = max(0, h - b) h1 = min(H-1, h + b) w0 = max(0, w - b) w1 = min(W-1, w + b) imos[h0][w0] += c imos[h0][w1 + 1] -= c imos[h1+1][w0] -= c imos[h1+1][w1+1] += c for h in range(1, H+1): for w in range(W+1): imos[h][w] += imos[h-1][w] for w in range(1, W+1): for h in range(H+1): imos[h][w] += imos[h][w-1] cs = [[0] * (W+2) for _ in range(H+2)] for h in range(H+1): for w in range(W+1): cs[h+1][w+1] = imos[h][w] for h in range(1, H+2): for w in range(W+2): cs[h][w] += cs[h-1][w] for w in range(1, W+2): for h in range(H+2): cs[h][w] += cs[h][w-1] ans = 0 for t, u, l, r, a in slime_info: t -= 1 u -= 1 l -= 1 r -= 1 if cs[u+1][r+1] - cs[u+1][l] - cs[t][r+1] + cs[t][l] < a: ans += 1 print(ans) if __name__ == '__main__': main()