from heapq import * N,M,X = map(int,input().split()) AB = [list(map(int,input().split())) for _ in range(N)] K = int(input()) C = list(map(int,input().split())) J = [[] for _ in range(M)] Y = [0] * N Q1 = [] Q2 = [] solved = set() for a,b in AB: b -= 1 J[b].append(a) for c in C: if c > 0: Y[c - 1] += 1 for i in range(M): if J[i]: J[i].sort() x = J[i].pop() heappush(Q1,(-x,i)) ans = 0 tmp = 0 for i in range(N): if Q2: if Q1: if Q1[0][0] - M < Q2[0][0]: x, jn = heappop(Q1) tmp += -x + X else: x, jn = heappop(Q2) tmp += -x else: x, jn = heappop(Q2) tmp += -x else: if Q1: x, jn = heappop(Q1) tmp += -x + X if J[jn]: heappush(Q2,(-J[jn].pop(),jn)) ans += tmp * Y[i] #print(i,tmp,Y[i],ans) print(ans)