#include <bits/stdc++.h>
using namespace std;
int N, m, dis;
int headline[100010];
struct edge {
  int nxt;
  int b;
} e[2 * 100010];
int tot;
bool mark[100010];
int max1[100010], max2[100010];
int num[100010];
int disup[100010], disdown[100010];
void INIT(void) {
  memset(headline, -1, sizeof(headline));
  memset(mark, false, sizeof(mark));
  memset(num, 0, sizeof(num));
  tot = 0;
}
void Addline(int u, int v) {
  tot++;
  e[tot].nxt = headline[u];
  e[tot].b = v;
  num[u]++;
  headline[u] = tot;
}
void dfsdown(int now, int fa) {
  if (num[now] == 1 && e[headline[now]].b == fa) {
    if (mark[now])
      disdown[now] = 0;
    else
      disdown[now] = INT_MIN;
    return;
  }
  max1[now] = max2[now] = INT_MIN;
  for (int i = headline[now]; i != -1; i = e[i].nxt) {
    int son = e[i].b;
    if (son == fa) continue;
    dfsdown(son, now);
    if (disdown[son] > max1[now]) {
      max2[now] = max1[now];
      max1[now] = disdown[son];
    } else if (disdown[son] > max2[now]) {
      max2[now] = disdown[son];
    }
  }
  disdown[now] = max1[now] + 1;
  if (disdown[now] < 0 && mark[now]) disdown[now] = 0;
}
void dfsup(int now, int fa) {
  if (fa == -1) {
    if (mark[now])
      disup[now] = 0;
    else
      disup[now] = INT_MIN;
  } else {
    if (disdown[now] == max1[fa]) {
      disup[now] = max2[fa] + 2;
    } else {
      disup[now] = max1[fa] + 2;
    }
    disup[now] =
        ((disup[now]) > (disup[fa] + 1) ? (disup[now]) : (disup[fa] + 1));
    if (disup[now] < 0 && mark[now]) disup[now] = 0;
  }
  if (num[now] == 1 && e[headline[now]].b == fa) return;
  for (int i = headline[now]; i != -1; i = e[i].nxt) {
    int son = e[i].b;
    if (son != fa) {
      dfsup(son, now);
    }
  }
}
int main(void) {
  while (3 == scanf("%d%d%d", &N, &m, &dis)) {
    INIT();
    for (int i = 1; i <= m; i++) {
      int temp;
      scanf("%d", &temp);
      mark[temp] = true;
    }
    for (int i = 1; i < N; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      Addline(u, v);
      Addline(v, u);
    }
    dfsdown(1, -1);
    dfsup(1, -1);
    int ans = 0;
    for (int i = 1; i <= N; i++) {
      if (((disdown[i]) > (disup[i]) ? (disdown[i]) : (disup[i])) <= dis) ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
