#include <bits/stdc++.h>
using namespace std;
vector<int> tree[100005];
int dp[100005], dp2[100005], mark[100005];
void dfs(int node, int p) {
  dp[node] = -100005;
  if (mark[node]) dp[node] = 0;
  for (auto i : tree[node]) {
    if (i != p) {
      dfs(i, node);
      if (mark[i] || dp[i]) dp[node] = max(dp[node], dp[i] + 1);
    }
  }
}
void dfs2(int node, int p, int val) {
  int mx1 = -100005;
  int mx2 = -100005;
  for (auto i : tree[node]) {
    if (i != p) {
      if (dp[i] > mx1) {
        swap(mx1, mx2);
        mx1 = dp[i];
      } else if (dp[i] > mx2)
        mx2 = dp[i];
    }
  }
  if (p != -1) dp2[node] = max(dp2[p] + 1, val + 2);
  if (mark[node]) dp2[node] = max(dp2[node], 0);
  for (auto i : tree[node]) {
    if (i != p) {
      if (dp[i] == mx1)
        dfs2(i, node, mx2);
      else
        dfs2(i, node, mx1);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, d;
  cin >> n >> m >> d;
  for (int i = 1; i <= m; i++) {
    int x;
    cin >> x;
    mark[x] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  if (mark[1])
    dp2[1] = 0;
  else
    dp2[1] = -100005;
  dfs(1, -1);
  dfs2(1, -1, -10);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (dp[i] <= d && dp2[i] <= d) ans++;
  }
  cout << ans;
  return 0;
}
