#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, m, d, dp[maxn][2], arr[maxn], visited[maxn];
vector<int> g[maxn];
void dfs(int u, int p) {
  visited[u] = 1;
  for (int v : g[u]) {
    if (!visited[v]) {
      dfs(v, u);
    }
  }
  if (arr[u]) {
    dp[u][0] = 0;
    dp[u][1] = 0;
  }
  int a = -1, b = -1;
  for (int v : g[u]) {
    if (v == p) continue;
    if (dp[v][0] > a) {
      b = a;
      a = dp[v][0];
    } else if (dp[v][0] > b) {
      b = dp[v][0];
    }
  }
  if (a != -1) {
    dp[u][0] = a + 1;
  }
  for (int v : g[u]) {
    if (v == p) continue;
    if (dp[v][0] == a) {
      if (b != -1) {
        dp[v][1] = 2 + b;
      }
    } else {
      if (a != -1) {
        dp[v][1] = 2 + a;
      }
    }
  }
}
void dfs_vx(int u, int p) {
  visited[u] = 1;
  if (dp[p][1] != -1) {
    dp[u][1] = max(dp[u][1], 1 + dp[p][1]);
  }
  for (int v : g[u]) {
    if (!visited[v]) {
      dfs_vx(v, u);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    arr[a] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  memset(visited, 0, sizeof(visited));
  dfs_vx(1, 0);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (max(dp[i][0], dp[i][1]) <= d) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
