#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
const int inf = 1e9;
int d;
vector<bool> isbad;
vector<int> maxd;
vector<int> max2d;
vector<int> gr[MAXN];
int calcMaxD(int v, int p) {
  maxd[v] = isbad[v] ? 0 : -inf;
  max2d[v] = maxd[v];
  for (auto i : gr[v]) {
    if (i != p) {
      int cd = calcMaxD(i, v) + 1;
      if (cd >= maxd[v]) {
        max2d[v] = maxd[v];
        maxd[v] = cd;
      } else if (cd > max2d[v]) {
        max2d[v] = cd;
      }
    }
  }
  return maxd[v];
}
int ans = 0;
void calcAns(int v, int pd, int p) {
  int w = max(maxd[v], pd);
  if (w <= d) ans++;
  for (auto i : gr[v]) {
    if (i != p) {
      if (maxd[i] + 1 == w) {
        calcAns(i, max(max2d[v] + 1, pd + 1), v);
      } else {
        calcAns(i, w + 1, v);
      }
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%d", &d);
  isbad.assign(n, false);
  for (int i = 0; i < m; ++i) {
    int x;
    scanf("%d", &x);
    isbad[x - 1] = true;
  }
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    --x;
    --y;
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  maxd.resize(n);
  max2d.resize(n);
  calcMaxD(0, -1);
  calcAns(0, -inf, -1);
  printf("%d\n", ans);
  puts("");
  return 0;
}
