#include <bits/stdc++.h>
using namespace std;
int nich[100005], upor[100005], isit[100005];
vector<int> graph[100005];
void go_nich(int now, int from) {
  int i;
  if (isit[now])
    nich[now] = 0;
  else
    nich[now] = -1000000000;
  for (i = 0; i < graph[now].size(); i++) {
    int to = graph[now][i];
    if (to == from) continue;
    go_nich(to, now);
    nich[now] = max(nich[now], 1 + nich[to]);
  }
  return;
}
void go_upor(int now, int from) {
  if ((graph[now].size() == 1 && from != -1) || (graph[now].size() == 0))
    return;
  if ((graph[now].size() == 1 && from == -1) ||
      (graph[now].size() == 2 && from != -1)) {
    int i;
    for (i = 0; i < graph[now].size(); i++) {
      int to = graph[now][i];
      if (to == from) continue;
      if (isit[to])
        upor[to] = 0;
      else
        upor[to] = -1000000000;
      upor[to] = max(upor[to], 1 + upor[now]);
      go_upor(to, now);
    }
    return;
  }
  int mx1 = -1000000000, mx2 = -1000000000, pp, i;
  for (i = 0; i < graph[now].size(); i++) {
    int to = graph[now][i];
    if (to == from) continue;
    if (nich[to] >= mx1) {
      pp = i;
      mx1 = nich[to];
    }
  }
  for (i = 0; i < graph[now].size(); i++) {
    int to = graph[now][i];
    if (to == from || i == pp) continue;
    mx2 = max(mx2, nich[to]);
  }
  for (i = 0; i < graph[now].size(); i++) {
    int to = graph[now][i];
    if (to == from) continue;
    if (isit[to])
      upor[to] = 0;
    else
      upor[to] = -1000000000;
    int temp;
    if (nich[to] == mx1)
      temp = mx2;
    else
      temp = mx1;
    upor[to] = max(upor[to], temp + 2);
    upor[to] = max(upor[to], upor[now] + 1);
    go_upor(to, now);
  }
  return;
}
int main() {
  int n, m, d, i;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &d);
  for (i = 0; i < m; i++) {
    int u;
    scanf("%d", &u);
    u--;
    isit[u] = 1;
  }
  for (i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    u--;
    v--;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  if (isit[0])
    upor[0] = 0;
  else
    upor[0] = -1000000000;
  go_nich(0, -1);
  go_upor(0, -1);
  int cnt = 0;
  for (i = 0; i < n; i++)
    if (max(upor[i], nich[i]) <= d) cnt++;
  cout << cnt << endl;
  return 0;
}
