#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int p[N], d1[N], d2[N];
vector<int> adj[N];
bool mark[N], q[N];
vector<int> dfs(int root) {
  mark[root] = true;
  vector<int> res;
  int ver1 = -1, ver2 = -1, dis1 = -1, dis2 = -1;
  res.push_back(-1);
  res.push_back(-1);
  res.push_back(-1);
  res.push_back(-1);
  res.push_back(-1);
  if (q[root]) {
    ver1 = root;
    dis1 = 0;
  }
  for (int i = 0; i < adj[root].size(); i++) {
    int u = adj[root][i];
    if (!mark[u]) {
      vector<int> v = dfs(u);
      if (v[2] > res[2]) {
        res[0] = v[0];
        res[1] = v[1];
        res[2] = v[2];
      }
      if (v[3] + 1 >= dis1 && v[3] >= 0) {
        dis2 = dis1;
        dis1 = v[3] + 1;
        ver2 = ver1;
        ver1 = v[4];
      } else if (v[3] + 1 > dis2 && v[3] >= 0) {
        dis2 = v[3] + 1;
        ver2 = v[4];
      }
    }
  }
  if (dis1 >= 0 && dis2 >= 0) {
    if (dis1 + dis2 > res[2]) {
      res[2] = dis1 + dis2;
      res[0] = ver1;
      res[1] = ver2;
    }
  }
  res[3] = dis1;
  res[4] = ver1;
  return res;
}
void bfs(int root, int h) {
  d2[root] = h;
  for (int i = 0; i < adj[root].size(); i++) {
    int u = adj[root][i];
    if (!d2[u]) bfs(u, h + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m, d, u, v;
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    cin >> p[i];
    p[i]--;
    q[p[i]] = true;
  }
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int root = p[0], root2 = -1;
  if (m > 1) {
    vector<int> v = dfs(0);
    root = v[0];
    root2 = v[1];
  }
  bfs(root, 1);
  for (int i = 0; i < n; i++) {
    d1[i] = d2[i];
    d2[i] = 0;
  }
  if (root2 != -1) bfs(root2, 1);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    bool z = (d1[i] - 1 <= d ? true : false);
    if (root2 != -1) z &= (d2[i] - 1 <= d ? true : false);
    ans += z;
  }
  cout << ans << endl;
}
