#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> adj[maxn], bro[maxn];
int dp[maxn], pd[maxn];
bool mark[maxn];
queue<int> q;
void dfsdp(int x) {
  mark[x] = 1;
  for (int i = 0; i < adj[x].size(); i++) {
    int child = adj[x][i];
    if (!mark[child])
      bro[x].push_back(child), dfsdp(child), dp[x] = max(dp[x], dp[child] + 1);
  }
}
void dfspd(int x) {
  mark[x] = 1;
  int dpmax1 = -100000, dpmax2 = -100000;
  for (int i = 0; i < bro[x].size(); i++) dpmax1 = max(dpmax1, dp[bro[x][i]]);
  int cnt = 0;
  for (int i = 0; i < bro[x].size(); i++) {
    if (dpmax1 == dp[bro[x][i]]) cnt++;
    if (dp[bro[x][i]] < dpmax1) dpmax2 = max(dpmax2, dp[bro[x][i]]);
  }
  if (cnt > 1) dpmax2 = dpmax1;
  for (int i = 0; i < bro[x].size(); i++) {
    int brother = bro[x][i];
    q.push(brother);
    if (dpmax1 == dp[brother])
      pd[brother] = max(pd[brother], dpmax2 + 2);
    else
      pd[brother] = max(pd[brother], dpmax1 + 2);
    pd[brother] = max(pd[brother], pd[x] + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, d;
  cin >> n >> m >> d;
  for (int i = 1; i <= n; i++) dp[i] = -1000000000, pd[i] = -1000000000;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    dp[x] = 0, pd[x] = 0;
  }
  for (int i = 1; i < n; i++) {
    int fi, se;
    cin >> fi >> se;
    adj[fi].push_back(se);
    adj[se].push_back(fi);
  }
  dfsdp(1);
  memset(mark, 0, sizeof mark);
  dfspd(1);
  while (!q.empty()) {
    int now = q.front();
    q.pop();
    dfspd(now);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int a = max(dp[i], pd[i]);
    if (a <= d) ans++;
  }
  cout << ans;
  return 0;
}
