#include <bits/stdc++.h>
using namespace std;
int N, M, R, C;
int mxdis, mxnode, sp[2][100005];
vector<int> V[100005];
bool E[100005];
void dfs(int node, int ata, int dis) {
  if (dis > mxdis && E[node]) {
    mxdis = dis;
    mxnode = node;
  }
  for (typeof(V[node].begin()) it = V[node].begin(); it != V[node].end(); it++)
    if (*it != ata) dfs(*it, node, dis + 1);
}
void dfs4(int node, int ata, int dis, bool w) {
  sp[w][node] = dis;
  for (typeof(V[node].begin()) it = V[node].begin(); it != V[node].end(); it++)
    if (*it != ata) dfs4(*it, node, dis + 1, w);
}
int main() {
  int u1, u2, x, y, d;
  scanf("%d %d %d", &N, &M, &d);
  for (int i = 1; i <= M; i++) {
    cin >> x;
    E[x] = 1;
  }
  for (int i = 1; i <= N - 1; i++) {
    cin >> x >> y;
    V[x].push_back(y);
    V[y].push_back(x);
  }
  int r = 1;
  dfs(1, -1, 0);
  u1 = mxnode;
  mxdis = 0;
  dfs(mxnode, -1, 0);
  u2 = mxnode;
  dfs4(u1, -1, 0, 0);
  dfs4(u2, -1, 0, 1);
  int res = 0;
  for (int i = 1; i <= N; i++) {
    if (sp[0][i] <= d && sp[1][i] <= d) ++res;
  }
  cout << res << endl;
  cerr << "\nTime: " << (double)clock() / CLOCKS_PER_SEC << " seconds." << endl;
  return 0;
}
