#include <bits/stdc++.h>
using namespace std;
const int64_t MAX = 1e5 * 2 + 10;
long long n, m, ans, cnt, a, b, sum1, sum2, c, d, x, y, z, mv, fv, sv,
    dis2[MAX], dis[MAX];
string s2;
char ch;
set<int64_t> st;
vector<int64_t> adj[MAX];
bool mark[MAX], m2[MAX];
queue<int64_t> q;
void bfs(int64_t v) {
  mark[v] = 1;
  while (q.size()) {
    x = q.front();
    q.pop();
    for (int64_t i = 0; i < adj[x].size(); i++) {
      int64_t u = adj[x][i];
      if (!mark[u]) {
        mark[u] = 1;
        q.push(u);
        dis[u] = dis[x] + 1;
      }
    }
  }
}
void bfs2(int64_t v) {
  mark[v] = 1;
  while (q.size()) {
    x = q.front();
    q.pop();
    for (int64_t i = 0; i < adj[x].size(); i++) {
      int64_t u = adj[x][i];
      if (!mark[u]) {
        mark[u] = 1;
        q.push(u);
        dis2[u] = dis2[x] + 1;
      }
    }
  }
}
void dfs(int64_t v) {
  mark[v] = 1;
  for (int64_t i = 0; i < adj[v].size(); i++) {
    int64_t u = adj[v][i];
    if (!mark[u]) {
      mark[u] = 1;
      dis2[u] = dis2[v] + 1;
      dfs(u);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> d;
  for (int64_t i = 0; i < m; i++) {
    cin >> x;
    m2[x] = 1;
  }
  for (int64_t i = 0; i < n - 1; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1);
  mv = 0;
  for (int64_t i = 1; i <= n; i++) {
    if (m2[i] && dis2[i] > mv) {
      mv = dis2[i];
      fv = i;
    }
  }
  cerr << fv << '\n';
  fill(mark, mark + n + 1, 0);
  fill(dis2, dis2 + n + 1, 0);
  mv = 0;
  dfs(fv);
  for (int64_t i = 1; i <= n; i++) {
    if (m2[i] && dis2[i] > mv) {
      mv = dis2[i];
      sv = i;
    }
  }
  cerr << sv << '\n';
  fill(mark, mark + n + 1, 0);
  fill(dis2, dis2 + n + 1, 0);
  q.push(fv);
  bfs(fv);
  fill(mark, mark + n + 1, 0);
  q.push(sv);
  bfs2(sv);
  for (int64_t i = 1; i <= n; i++) {
    dis[i] = max(dis[i], dis2[i]);
  }
  for (int64_t i = 1; i <= n; i++) {
    if (dis[i] <= d) {
      ans++;
    }
  }
  cout << ans;
}
