#include <bits/stdc++.h>
using namespace std;
int N, M, d, D[100000], P[100000];
vector<int> g[100000];
int pre(int i, int p) {
  int ret = D[i] ? 0 : -1;
  for (auto j : g[i])
    if (j != p) {
      int curr = pre(j, i);
      if (curr == -1) continue;
      ret = max(ret, 1 + curr);
    }
  return P[i] = ret;
}
void add(int i, int v, vector<pair<int, int>> &list) {
  if (list.size() < 2) {
    list.push_back({v, i});
    sort(list.begin(), list.end());
  } else {
    if (list[0].first < v) {
      list[0] = {v, i};
      sort(list.begin(), list.end());
    }
  }
}
int get(vector<pair<int, int>> list, int no) {
  int ret = -1;
  for (auto pair : list)
    if (pair.second != no) ret = max(ret, pair.first);
  return ret;
}
int dfs(int i, int p, int c) {
  int ret = 0;
  int maxD = max(c, P[i]);
  if (maxD <= d) ret++;
  vector<pair<int, int>> list;
  if (D[i]) add(-2, 0, list);
  add(-2, c, list);
  for (auto j : g[i])
    if (j != p) {
      if (P[j] == -1) continue;
      add(j, P[j] + 1, list);
    }
  for (auto j : g[i])
    if (j != p) {
      int pass = get(list, j);
      ret += dfs(j, i, pass == -1 ? -1 : pass + 1);
    }
  return ret;
}
int main() {
  cin >> N >> M >> d;
  for (int k = 0; k < M; k++) {
    int a;
    cin >> a;
    a--;
    D[a] = 1;
  }
  for (int k = 0; k < N - 1; k++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  pre(0, -1);
  int ret = dfs(0, -1, -1);
  cout << ret << endl;
  return 0;
}
