#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, m, d, ans;
struct node;
struct edge {
  node *ed;
  edge *next;
} E[N << 1], *newE = E;
struct node {
  edge *son;
  node *pa;
  bool flag;
  int dist[2], dis;
  void dfs() {
    dist[0] = dist[1] = dis = -1e8;
    if (flag) dist[0] = 0;
    for (edge *e = son; e; e = e->next)
      if (e->ed != pa) {
        e->ed->pa = this;
        e->ed->dfs();
        if (e->ed->dist[0] + 1 > dist[0]) {
          dist[1] = dist[0];
          dist[0] = e->ed->dist[0] + 1;
        } else if (e->ed->dist[0] + 1 > dist[1]) {
          dist[1] = e->ed->dist[0] + 1;
        }
      }
  }
  void dfs2() {
    if (flag)
      if (dis < 0) dis = 0;
    if (max(dis, dist[0]) <= d) ans++;
    for (edge *e = son; e; e = e->next)
      if (e->ed != pa) {
        e->ed->dis =
            max(dis, e->ed->dist[0] == dist[0] - 1 ? dist[1] : dist[0]) + 1;
        e->ed->dfs2();
      }
  }
} V[N];
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0; i < m; i++) {
    int p;
    scanf("%d", &p);
    V[p].flag = 1;
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    *newE = (edge){V + y, V[x].son}, V[x].son = newE++;
    *newE = (edge){V + x, V[y].son}, V[y].son = newE++;
  }
  V[1].dfs();
  V[1].dfs2();
  printf("%d\n", ans);
}
