#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int R, D, n, m, d, h[100001];
vector<int> adj[N];
bool ans[N], mark[N];
void dfs(int u, int p = 0) {
  h[u] = h[p] + 1;
  ans[u] &= (h[u] <= d);
  if (mark[u] && h[u] > D) D = h[u], R = u;
  for (int i = 0; i < adj[u].size(); ++i) {
    int v = adj[u][i];
    if (v != p) dfs(v, u);
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 0; i < N; i++) ans[i] = true;
  h[0] = -1;
  int a, b, i;
  D = 0;
  for (i = 0; i < m; ++i) {
    cin >> R;
    mark[R] = true;
  }
  for (i = 0; i < n - 1; ++i) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(R);
  dfs(R);
  dfs(R);
  dfs(R);
  int ret = 0;
  for (i = 1; i <= n; ++i)
    if (ans[i]) ++ret;
  cout << ret << endl;
}
