#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int add(int x, int y, int CMOD = MOD) { return (0LL + x + y) % CMOD; }
int mult(int x, int y, int CMOD = MOD) { return (1LL * x * y) % CMOD; }
long long fast_expo(long long x, long long y, long long CMOD = MOD) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  long long ans = fast_expo(x, y / 2, CMOD);
  ans = mult(ans, ans, CMOD);
  if (y & 1) ans = mult(ans, x, CMOD);
  return ans;
}
const int TAM = 1e5 + 100;
const int INF = INT_MAX / 4;
vector<int> G[TAM];
int n, m, d;
bool h[TAM];
int in[TAM];
int ans = 0;
void dfs1(int u, int pd) {
  in[u] = -INF;
  if (h[u]) in[u] = 0;
  for (int v : G[u]) {
    if (v != pd) {
      dfs1(v, u);
      in[u] = max(in[u], in[v] + 1);
    }
  }
}
void dfs2(int u, int pd, int out) {
  if (max(out, in[u]) <= d) ans++;
  set<pair<int, int> > s;
  for (int v : G[u]) {
    if (v == pd) continue;
    s.insert({in[v], v});
    if (s.size() > 2) s.erase(s.begin());
  }
  if (s.size() == 1) {
    int m1 = s.begin()->second;
    dfs2(m1, u, max(out + 1, h[u] ? 1 : -INF));
  } else if (s.size() == 2) {
    int m2 = s.begin()->second;
    int m1 = s.rbegin()->second;
    for (int v : G[u]) {
      if (v == pd) continue;
      dfs2(v, u,
           max(h[u] ? 1 : -INF,
               max(out + 1, v == m1 ? in[m2] + 2 : in[m1] + 2)));
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    x--;
    h[x] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs1(0, -1);
  dfs2(0, -1, -INF);
  printf("%d\n", ans);
  return 0;
}
