#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, m, d, cool[100005], mx1[100005], mx2[100005];
vector<vector<int> > g;
int dfs1(int u, int p) {
  if (cool[u]) {
    mx1[u] = 0;
  }
  for (size_t i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v != p) {
      int val = dfs1(v, u);
      if (val) {
        if (val > mx2[u]) {
          mx2[u] = val;
        }
        if (mx2[u] > mx1[u]) {
          swap(mx1[u], mx2[u]);
        }
      }
    }
  }
  return mx1[u] + 1;
}
void dfs2(int u, int p) {
  if (p != -1) {
    if (mx1[p] != -1) {
      if (mx1[u] != -1 && mx1[u] + 1 == mx1[p]) {
        if (mx2[p] != -1) {
          mx2[u] = max(mx2[u], mx2[p] + 1);
          if (mx1[u] < mx2[u]) {
            swap(mx1[u], mx2[u]);
          }
        }
      } else {
        mx2[u] = max(mx2[u], mx1[p] + 1);
        if (mx1[u] < mx2[u]) {
          swap(mx1[u], mx2[u]);
        }
      }
    }
  }
  for (size_t i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v != p) {
      dfs2(v, u);
    }
  }
}
void solve() {
  memset(mx1, -1, sizeof(mx1));
  memset(mx2, -1, sizeof(mx2));
  dfs1(0, -1);
  dfs2(0, -1);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (mx1[i] <= d) {
      ans++;
    }
  }
  printf("%d\n", ans);
}
int main() {
  while (cin >> n >> m >> d) {
    g = vector<vector<int> >(n);
    for (int i = 0; i < m; i++) {
      int p;
      scanf("%d", &p);
      cool[p - 1] = 1;
    }
    for (int i = 0; i < n - 1; i++) {
      int a, b;
      scanf("%d %d", &a, &b);
      a--;
      b--;
      g[a].push_back(b);
      g[b].push_back(a);
    }
    solve();
  }
}
