#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<int> gr[100001];
int m1[100001], m2[100001];
int mark[100001], isp[100001];
int dfs(int x) {
  mark[x] = 1;
  m1[x] = -2;
  m2[x] = -2;
  if (isp[x]) m1[x] = 0;
  for (int i = 0; i < gr[x].size(); i++) {
    if (!mark[gr[x][i]]) {
      int k = dfs(gr[x][i]) + 1;
      if (k < 0) continue;
      if (m1[x] < k) {
        m2[x] = m1[x];
        m1[x] = k;
      } else if (m2[x] < k)
        m2[x] = k;
    }
  }
  return m1[x];
}
int book[100001];
void go(int x, int ds) {
  mark[x] = 1;
  int res = 0;
  if (ds > d) {
    book[x] = 1;
    for (int i = 0; i < gr[x].size(); i++) {
      if (!mark[gr[x][i]]) go(gr[x][i], ds);
    }
    return;
  }
  for (int i = 0; i < gr[x].size(); i++) {
    if (!mark[gr[x][i]]) {
      int p = ds;
      if (m1[gr[x][i]] + 1 == m1[x])
        p = max(p, m2[x]);
      else
        p = max(p, m1[x]);
      go(gr[x][i], p + 1);
    }
  }
  if (m1[x] > d) book[x] = 1;
}
int main() {
  memset(isp, 0, sizeof isp);
  int p;
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    cin >> p;
    isp[p - 1] = 1;
  }
  p--;
  memset(mark, 0, sizeof mark);
  int x, y;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    gr[x - 1].push_back(y - 1);
    gr[y - 1].push_back(x - 1);
  }
  dfs(p);
  memset(mark, 0, sizeof mark);
  memset(book, 0, sizeof mark);
  go(p, 0);
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (!book[i]) ans++;
  cout << ans << endl;
  return 0;
}
