#include <bits/stdc++.h>
using namespace std;
const int maxN = 100 * 1000 + 10;
int n, m, d;
int mark[maxN], dp1[maxN], dp2[maxN], red[maxN], h[maxN];
vector<int> adj[maxN];
void dfs1(int v) {
  mark[v] = true;
  int maxx = -1, tt = 0;
  if (red[v]) maxx = 0, h[v]++;
  for (int i = 0; i < adj[v].size(); i++) {
    int x = adj[v][i];
    if (!mark[x]) {
      dfs1(x);
      h[v] += h[x];
      if (h[x]) maxx = max(maxx, dp1[x] + 1);
    }
  }
  dp1[v] = maxx;
}
void dfs2(int v, int par) {
  vector<pair<int, int> > a;
  for (int i = 0; i < adj[v].size(); i++) {
    int x = adj[v][i];
    if (x != par) {
      a.push_back(make_pair(dp1[x], x));
      if (red[v] && dp2[v] == -1)
        dp2[x] = 1;
      else if (dp2[v] >= 1)
        dp2[x] = dp2[v] + 1;
      else
        dp2[x] = -1;
    }
  }
  a.push_back(make_pair(-1, -1));
  sort(a.begin(), a.end(), greater<pair<int, int> >());
  for (int i = 0; i < adj[v].size(); i++) {
    int x = adj[v][i];
    if (x != par) {
      if (x != a[0].second)
        dp2[x] = max(dp2[x], a[0].first + 2);
      else if (a[1].first == -1) {
      } else
        dp2[x] = max(dp2[x], a[1].first + 2);
    }
  }
  for (int i = 0; i < adj[v].size(); i++) {
    int x = adj[v][i];
    if (x != par) dfs2(x, v);
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> d;
  while (m--) {
    int x;
    cin >> x;
    red[--x] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  fill(dp1, dp1 + n + 1, -1);
  dfs1(0);
  dp2[0] = -1;
  dfs2(0, 0);
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if (max(dp2[i], dp1[i]) <= d && max(dp2[i], dp1[i]) >= 0) cnt++;
  cout << cnt;
  return 0;
}
