#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > Edges(100006);
int D, mxchild[100006], mxsib[100006], mxfpar[100006], mxnode[100006];
bool dnode[100006];
int dfs1(int parent, int node) {
  int ret = -1, i, now, temp, n;
  vector<pair<int, int> > V;
  for (i = 0; i < Edges[node].size(); ++i) {
    now = Edges[node][i];
    if (now == parent) continue;
    temp = dfs1(node, now);
    if (temp == -1) continue;
    V.push_back(make_pair(temp, now));
    if (temp + 1 > ret) ret = temp + 1;
  }
  sort(V.begin(), V.end());
  if (V.size() >= 1) {
    n = V[V.size() - 1].second, temp = V[V.size() - 1].first;
    for (i = 0; i < Edges[node].size(); ++i) {
      now = Edges[node][i];
      if (now == parent || now == n) continue;
      mxsib[now] = temp + 2;
    }
  }
  if (V.size() >= 2) mxsib[n] = V[V.size() - 2].first + 2;
  mxchild[node] = ret;
  if (dnode[node] && ret == -1) ret = 0;
  return ret;
}
void dfs2(int parent, int node) {
  if (parent != -1) {
    mxfpar[node] = ((mxfpar[parent]) > (mxsib[parent]) ? (mxfpar[parent])
                                                       : (mxsib[parent]));
    if (mxfpar[node] != -1) ++mxfpar[node];
  }
  if (mxfpar[node] == -1 && dnode[node]) mxfpar[node] = 0;
  mxnode[node] =
      ((mxfpar[node]) > (((mxchild[node]) > (mxsib[node]) ? (mxchild[node])
                                                          : (mxsib[node])))
           ? (mxfpar[node])
           : (((mxchild[node]) > (mxsib[node]) ? (mxchild[node])
                                               : (mxsib[node]))));
  int now, i;
  for (i = 0; i < Edges[node].size(); ++i) {
    now = Edges[node][i];
    if (now == parent) continue;
    dfs2(node, now);
  }
}
void prep(int N) {
  memset(mxchild, -1, sizeof(mxchild));
  memset(mxsib, -1, sizeof(mxsib));
  memset(mxfpar, -1, sizeof(mxfpar));
  memset(mxnode, -1, sizeof(mxnode));
  dfs1(-1, 1);
  dfs2(-1, 1);
  int i;
}
int main() {
  int N, M, i, u, v, ans;
  while (scanf("%d %d %d", &N, &M, &D) != EOF) {
    memset(dnode, false, sizeof(dnode));
    for (i = 1; i <= N; ++i) Edges[i].clear();
    for (i = 1; i <= M; ++i) {
      scanf("%d", &u);
      dnode[u] = true;
    }
    for (i = 1; i < N; ++i) {
      scanf("%d %d", &u, &v);
      Edges[u].push_back(v);
      Edges[v].push_back(u);
    }
    prep(N);
    ans = 0;
    for (i = 1; i <= N; ++i) {
      if (mxnode[i] <= D) ++ans;
    }
    printf("%d\n", ans);
  }
  return 0;
}
