#include <bits/stdc++.h>
using namespace std;
int N, M, D, T;
vector<int> G[100010];
int distup[100010], distdown[100010], father[100010], dd[100010], ff[100010];
bool aff[100010];
void dfsd(int u) {
  int i, Max = -10000000, cur;
  dd[u] = -10000000;
  for (i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == father[u]) continue;
    dfsd(v);
    if (aff[v])
      cur = (distdown[v] + 1 > 1 ? distdown[v] + 1 : 1);
    else
      cur = distdown[v] + 1;
    if (cur > Max) {
      dd[u] = Max;
      Max = cur;
      ff[u] = v;
    } else
      dd[u] = (dd[u] > cur ? dd[u] : cur);
  }
  distdown[u] = Max;
}
void dfsu(int u) {
  int i, Max = -10000000, f = father[u], cur;
  if (u == ff[f])
    Max = dd[f] + 1;
  else
    Max = distdown[f] + 1;
  if (aff[f])
    cur = (distup[f] + 1 > 1 ? distup[f] + 1 : 1);
  else
    cur = distup[f] + 1;
  Max = (Max > cur ? Max : cur);
  distup[u] = Max;
  for (i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == father[u]) continue;
    dfsu(v);
  }
}
void build(int u) {
  int i;
  for (i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == father[u]) continue;
    father[v] = u;
    build(v);
  }
}
int main() {
  int i;
  scanf("%d%d%d", &N, &M, &D);
  memset(aff, false, sizeof(aff));
  for (i = 1; i <= M; i++) {
    int x;
    scanf("%d", &x);
    aff[x] = true;
  }
  for (i = 0; i <= N; i++) G[i].clear();
  for (i = 1; i < N; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  memset(father, 0, sizeof(father));
  memset(distdown, 0, sizeof(distdown));
  memset(distup, 0, sizeof(distup));
  distup[0] = distdown[0] = dd[0] = -10000000;
  build(1);
  dfsd(1);
  dfsu(1);
  T = 0;
  for (i = 1; i <= N; i++)
    if (distup[i] <= D && distdown[i] <= D) T++;
  printf("%d\n", T);
  return 0;
}
