#include <bits/stdc++.h>
using namespace std;
bool wolf[100005];
int longest[100005], fir[100005], sec[100005], dp[100005];
vector<int> son[100005];
void dfs(int root, int fa) {
  int i, v, numson = son[root].size();
  for (i = 0; i < numson; i++) {
    v = son[root][i];
    if (v == fa) {
      continue;
    }
    dfs(v, root);
    if ((fir[v] == 0 && wolf[v]) || (fir[v] != 0))
      if (fir[v] + 1 > fir[root]) {
        fir[root] = fir[v] + 1;
        longest[root] = i;
      }
  }
  for (i = 0; i < numson; i++) {
    v = son[root][i];
    if (v == fa) {
      continue;
    }
    if ((fir[v] == 0 && wolf[v]) || (fir[v] != 0))
      if (fir[v] + 1 > sec[root] && i != longest[root]) {
        sec[root] = fir[v] + 1;
      }
  }
}
void sdfs(int root, int fa) {
  int i, numson = son[root].size();
  for (i = 0; i < numson; i++) {
    if (son[root][i] == fa) {
      continue;
    }
    if ((dp[root] == 0 && wolf[root]) || (dp[root] != 0))
      if (i == longest[root]) {
        dp[son[root][i]] = max(dp[root], sec[root]) + 1;
      } else {
        dp[son[root][i]] = max(dp[root], fir[root]) + 1;
      }
    else if (i == longest[root]) {
      if (sec[root] != 0) dp[son[root][i]] = sec[root] + 1;
    } else {
      if (fir[root] != 0) dp[son[root][i]] = fir[root] + 1;
    }
    sdfs(son[root][i], root);
  }
}
int main() {
  int i, n, m, d, tmp, a, b, ans;
  scanf("%d %d %d", &n, &m, &d);
  for (i = 0; i < m; i++) {
    scanf("%d", &tmp);
    wolf[tmp] = true;
  }
  for (i = 1; i < n; i++) {
    scanf("%d %d", &a, &b);
    son[a].push_back(b);
    son[b].push_back(a);
  }
  dfs(1, 1);
  dp[1] = 0;
  sdfs(1, 1);
  ans = 0;
  for (i = 1; i <= n; i++) {
    if (max(fir[i], dp[i]) <= d) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
