#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:33554432")
using namespace std;
int n, m, d;
vector<int> G[1 << 17];
vector<pair<int, int> > ch[1 << 17];
int bad[1 << 17];
int Max[1 << 17];
int go1(int x, int p = -1) {
  if (bad[x]) Max[x] = 0;
  for (int i = 0; i < G[x].size(); ++i) {
    int to = G[x][i];
    if (to == p) continue;
    int cur = go1(to, x);
    if (cur == -1) continue;
    Max[x] = max(Max[x], cur + 1);
  }
  return Max[x];
}
int go2(int x, int p, int up) {
  if (bad[x]) up = max(up, 0);
  int res = 0;
  for (int i = 0; i < G[x].size(); ++i) {
    int to = G[x][i];
    if (to == p) continue;
    int cur = Max[to];
    if (cur != -1) cur++;
    ch[x].push_back(make_pair(cur, to));
  }
  sort(ch[x].rbegin(), ch[x].rend());
  if (ch[x].size() == 0) return up >= 0 && up <= d;
  int cur = max(up, ch[x][0].first);
  if (cur >= 0 && cur <= d) res++;
  if (ch[x].size() == 1) {
    int next = up == -1 ? -1 : up + 1;
    res += go2(ch[x][0].second, x, next);
    return res;
  }
  for (int i = 0; i < G[x].size(); ++i) {
    int to = G[x][i];
    if (to == p) continue;
    int MAX;
    if (to == ch[x][0].second)
      MAX = ch[x][1].first;
    else
      MAX = ch[x][0].first;
    int next = max(MAX, up);
    if (next != -1) next++;
    res += go2(to, x, next);
  }
  return res;
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  memset(bad, 0, sizeof(bad));
  memset(Max, -1, sizeof(Max));
  for (int i = 0; i < m; ++i) {
    int x;
    scanf("%d", &x);
    x--;
    bad[x] = 1;
  }
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--, v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  go1(0);
  printf("%d\n", go2(0, -1, -1));
  return 0;
}
