from collections import Counter import heapq as hq N, M, X = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(N)] K = int(input()) C = list(map(int, input().split())) D = Counter(C) INF = 10**9 qual = 0 ct = 0 set1 = [(INF, 0)] set2 = [(INF, 0)] for a, b in A: hq.heappush(set2, (-a, b)) S = set() ans = 0 for i in range(1, N+1): while set2[0][1] in S: a = hq.heappop(set2) hq.heappush(set1, a) v = -set1[0][0] w = -set2[0][0] if v <= w+X: qual += w ct += 1 S.add(set2[0][1]) hq.heappop(set2) else: qual += v hq.heappop(set1) ans += D[i]*(qual+ct*X) print(ans)