#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
const int mod = 1e9 + 9;
int root, n, m, d;
vector<int> g[N];
int du[N], dw[N], bad[N], bg[N];
void dfs(int v, int pr = 1) {
  dw[v] = (bad[v] ? 0 : -1);
  for (int u : g[v]) {
    if (u == pr) continue;
    dfs(u, v);
    if (dw[u] != -1) {
      dw[v] = max(dw[v], dw[u] + 1);
    }
  }
}
void dfs2(int v, int pr = 1) {
  int mx1 = -1, mx2 = -1;
  for (int u : g[v]) {
    if (u == pr) continue;
    if (dw[u] > mx1) {
      mx2 = mx1;
      mx1 = dw[u];
    } else if (dw[u] > mx2) {
      mx2 = dw[u];
    }
  }
  for (int u : g[v]) {
    if (u == pr) continue;
    int mx3 = (dw[u] == mx1 ? mx2 : mx1);
    if (mx3 != -1) mx3 += 2;
    if (du[v] != -1) {
      mx3 = max(mx3, du[v] + 1);
    }
    if (bad[v]) mx3 = max(mx3, 1);
    du[u] = mx3;
    dfs2(u, v);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> d;
  for (int i = 1, x; i <= m; i++) {
    cin >> x;
    bad[x] = 1;
  }
  root = bg[1];
  for (int i = 1, x, y; i < n; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1);
  if (!bad[1]) du[1] = -1;
  dfs2(1);
  int res = 0;
  for (int i = 1; i <= n; i++) {
    res += (max(dw[i], du[i]) <= d);
  }
  cout << res;
  return 0;
}
