#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long SIZE = 1e5 + 5;
const long long mod = 1e9 + 7;
vector<long long> adj[SIZE];
long long in[SIZE], out[SIZE];
long long dp[SIZE];
long long n, m, d;
bool bad[SIZE];
void dfs1(long long u, long long p) {
  long long i, v;
  for (i = 0; i < adj[u].size(); i++) {
    v = adj[u][i];
    if (v == p) continue;
    dfs1(v, u);
    if (in[v]) in[u] = max(in[u], 1 + in[v]);
  }
}
void dfs2(long long u, long long p) {
  long long i, v;
  long long mx, mx1 = -1, mx2 = -1;
  for (i = 0; i < adj[u].size(); i++) {
    v = adj[u][i];
    if (v == p) continue;
    if (in[v] >= mx1 && in[v]) {
      mx2 = mx1;
      mx1 = in[v];
    } else if (in[v] > mx2 && in[v])
      mx2 = in[v];
  }
  for (i = 0; i < adj[u].size(); i++) {
    v = adj[u][i];
    if (v == p) continue;
    mx = mx1;
    if (mx == in[v]) mx = mx2;
    if (out[u] && mx != -1)
      out[v] = max(1 + out[u], 2 + mx);
    else if (!out[u] && mx != -1)
      out[v] = 2 + mx;
    else if (mx == -1 && out[u])
      out[v] = 1 + out[u];
    dfs2(v, u);
  }
}
int main() {
  long long t = 0, x, y, z, i, j, k, g, p, q, ans = 0, sum = 0, c = 0;
  scanf("%lld %lld", &n, &m);
  scanf("%lld", &d);
  for (i = 1; i <= m; i++) {
    scanf("%lld", &x);
    bad[x] = 1;
    out[x] = 1;
    in[x] = 1;
  }
  for (i = 1; i <= n - 1; i++) {
    scanf("%lld %lld", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs1(1, 0);
  dfs2(1, 0);
  for (i = 1; i <= n; i++) {
    if (in[i]) in[i]--;
    if (out[i]) out[i]--;
  }
  for (i = 1; i <= n; i++) {
    dp[i] = max(in[i], out[i]);
    if (dp[i] <= d) ans++;
  }
  printf("%lld\n", ans);
  return 0;
}
