#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <climits>
#include <map>
#include <queue>
#include <set>
#include <cstring>
#include <vector>

using namespace std;
typedef long long ll;

struct Node {
  ll value;
  int type;
  bool has_bonus;

  Node(ll value = -1, int type = -1, bool has_bonus = true) {
    this->value = value;
    this->type = type;
    this->has_bonus = has_bonus;
  }

  bool operator>(const Node &n) const {
    return value < n.value;
  }
};

int main() {
  int N, M;
  ll X;
  cin >> N >> M >> X;
  priority_queue <Node, vector<Node>, greater<Node>> pque;

  for (int i = 0; i < N; ++i) {
    int a, b;
    cin >> a >> b;
    pque.push(Node(a + X, b, true));
  }

  int K;
  cin >> K;
  vector<int> C(K);
  for (int i = 0; i < K; ++i) {
    cin >> C[i];
  }

  int cnt = 0;
  ll values[N + 1];
  memset(values, 0, sizeof(values));

  ll sum = 0;
  priority_queue <Node, vector<Node>, greater<Node>> pque_2;
  bool checked[M + 1];
  memset(checked, false, sizeof(checked));

  while (not pque.empty()) {
    Node node = pque.top();
    pque.pop();

    if (checked[node.type] && node.has_bonus) {
      node.value -= X;
      node.has_bonus = false;
      pque.push(node);
      continue;
    }
    checked[node.type] = true;
    sum += node.value;
    cnt++;
    values[cnt] = sum;
  }

  ll ans = 0;

  for (int c : C) {
    ans += values[c];
  }

  cout << ans << endl;

  return 0;
}