#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, next;
} road[100005 * 2];
struct nodd {
  int max1, max2, num;
} msg[100005];
int m, n, d, start[100005], tot = 0, f[100005];
bool mark[100005];
void build(int x, int y) {
  tot++, road[tot].x = x, road[tot].y = y, road[tot].next = start[x];
  start[x] = tot;
}
void init() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 1; i <= m; i++) {
    int p;
    scanf("%d", &p);
    mark[p] = true;
  }
  for (int i = 1; i <= n - 1; i++) {
    int p, q;
    scanf("%d%d", &p, &q);
    build(p, q), build(q, p);
  }
}
void df_1(int x, int fa) {
  if (mark[x] == true) msg[x].max1 = 0, f[x] = 0;
  for (int i = start[x]; i; i = road[i].next)
    if (road[i].y != fa) {
      df_1(road[i].y, x);
      int q = road[i].y;
      f[x] = max(f[x], f[q] + 1);
      if (msg[q].max1 >= 0 && msg[x].max1 <= msg[q].max1 + 1)
        msg[x].max2 = msg[x].max1, msg[x].max1 = msg[q].max1 + 1,
        msg[x].num = q;
      else if (msg[q].max1 >= 0 && msg[x].max2 <= msg[q].max1 + 1)
        msg[x].max2 = msg[q].max1 + 1;
    }
}
void df_2(int x, int fa, int deep, int Max) {
  for (int i = start[x]; i; i = road[i].next)
    if (road[i].y != fa) {
      int q = road[i].y;
      if (msg[x].num == q) {
        int t = max(Max, msg[x].max2 - deep);
        f[q] = max(f[q], t + deep + 1);
        df_2(q, x, deep + 1, t);
      } else {
        int t = max(Max, msg[x].max1 - deep);
        f[q] = max(f[q], t + deep + 1);
        df_2(q, x, deep + 1, t);
      }
    }
}
void work() {
  for (int i = 1; i <= n; i++)
    msg[i].max1 = msg[i].max2 = -0x3f3f3f3f, msg[i].num = 0;
  for (int i = 1; i <= n; i++) f[i] = -0x3f3f3f3f;
  df_1(1, 0);
  df_2(1, 0, 0, -0x3f3f3f3f);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (f[i] <= d) ans++;
  printf("%d\n", ans);
}
int main() {
  init();
  work();
  return 0;
}
