# coding: utf-8 # Your code here! import sys readline = sys.stdin.readline h,w,n,m = map(int,readline().split()) tulra = [list(map(int,readline().split())) for _ in range(n)] b = [[0]*(w+1) for _ in range(h+1)] for _ in range(m): x,y,d,c = map(int,readline().split()) x -= 1 y -= 1 lx = max(0,x-d) rx = min(h,x+d+1) ly = max(0,y-d) ry = min(w,y+d+1) b[lx][ly] += c b[rx][ly] += -c b[lx][ry] += -c b[rx][ry] += c for i in range(h+1): for j in range(w): b[i][j+1] += b[i][j] for j in range(w+1): for i in range(h): b[i+1][j] += b[i][j] for i in range(h+1): for j in range(w): b[i][j+1] += b[i][j] for j in range(w+1): for i in range(h): b[i+1][j] += b[i][j] ans = 0 for t,u,l,r,a in tulra: t -= 1 u -= 1 l -= 1 r -= 1 #print(t,u,l,r,a) #print((b[t][l] if t and l else 0), (b[u][l-1] if l else 0), (b[t-1][r] if t else 0), b[u][r]) v = (b[t-1][l-1] if t and l else 0) - (b[u][l-1] if l else 0) - (b[t-1][r] if t else 0) + b[u][r] ans += int(a > v) #print(v) print(ans)