n,m,x = map(int,input().split()) ab = [] for _ in range(n): a,b = map(int,input().split()) ab.append([a,b]) ab.sort(key = lambda x:(-x[0],x[1])) ab_ans = [] vis = [0] * n from collections import defaultdict d = defaultdict(int) rui = 0 syu = 0 j = 0 for i in range(n): a,b = ab[i] if vis[i] == 1:continue if d[b] == 0: ab_ans.append([a,b]) syu += 1 rui += syu * k + a vis[j] = 1 d[b] += 1 else: j = max(i+1,j) while j <= n-1 : if d[ab[j][1]] == 0: if a + syu * x <= (syu + 1) * x + ab[j][0]: # print(i,j,a + syu * x, (kari_syu + 1) * x + ab[j][0]) vis[j] = 1 ab_ans.append([ab[j][0],ab[j][1]]) d[ab[j][1]] += 1 syu += 1 else: break j += 1 ab_ans.append([a,b]) vis[i] = 1 d[b] += 1 k = int(input()) c = list(map(int,input().split())) rui = [0] * n rui_syu = [0] * n d = defaultdict(int) syu = 0 for i in range(n): a,b = ab_ans[i] if d[b] == 0: syu += 1 rui_syu[i] += syu * x d[b] += 1 else : rui_syu[i] += rui_syu[i-1] rui[i] = a for i in range(1,n): rui[i] += rui[i-1] ans = 0 for i in range(k): if c[i] == 0:continue ans += rui[c[i]-1] + rui_syu[c[i]-1] print(ans)