#include <bits/stdc++.h>
using namespace std;
int n, m, d, dist[100005], dist2[100005];
vector<int> ht, ve[100005];
queue<int> que;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> d;
  for (int j = 0; j < m; j++) {
    int h;
    cin >> h;
    ht.push_back(h);
  }
  for (int i = 0; i < n - 1; i++) {
    int f, t;
    cin >> f >> t;
    ve[f].push_back(t);
    ve[t].push_back(f);
  }
  for (int i = 0; i < 100005; i++) dist[i] = -1;
  que.push(ht[0]);
  dist[ht[0]] = 0;
  while (!que.empty()) {
    int x = que.front();
    que.pop();
    for (int i = 0; i < ve[x].size(); i++) {
      if (dist[ve[x][i]] == -1) {
        dist[ve[x][i]] = dist[x] + 1;
        que.push(ve[x][i]);
      }
    }
  }
  int max1 = 0;
  for (int i = 0; i < ht.size(); i++) {
    if (dist[ht[i]] > dist[max1]) max1 = ht[i];
  }
  for (int i = 0; i < 100005; i++) dist[i] = -1;
  que.push(max1);
  dist[max1] = 0;
  while (!que.empty()) {
    int x = que.front();
    que.pop();
    for (int i = 0; i < ve[x].size(); i++) {
      if (dist[ve[x][i]] == -1) {
        dist[ve[x][i]] = dist[x] + 1;
        que.push(ve[x][i]);
      }
    }
  }
  int max2 = 0;
  for (int i = 0; i < ht.size(); i++) {
    if (dist[ht[i]] > dist[max2]) max2 = ht[i];
  }
  for (int i = 0; i < 100005; i++) dist2[i] = -1;
  que.push(max2);
  dist2[max2] = 0;
  while (!que.empty()) {
    int x = que.front();
    que.pop();
    for (int i = 0; i < ve[x].size(); i++) {
      if (dist2[ve[x][i]] == -1) {
        dist2[ve[x][i]] = dist2[x] + 1;
        que.push(ve[x][i]);
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (dist[i] <= d && dist2[i] <= d) cnt++;
  }
  cout << cnt;
  return 0;
}
