#include <bits/stdc++.h>
const long long LL_INF = (long long)2e18 + 5;
using namespace std;
void __print(int32_t x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  long long f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
const long long N = 1e5 + 100, mod = 998244353;
vector<long long> adj[N], dp, dpU, sum;
long long n, m, d;
set<long long> s;
void dfs(long long u, long long par) {
  if (s.count(u)) dp[u] = 0;
  for (auto v : adj[u]) {
    if (v == par) continue;
    dfs(v, u);
    dp[u] = max(dp[u], dp[v] + 1);
  }
}
void dfs_up(long long u, long long par) {
  for (auto v : adj[u]) {
    if (v == par)
      sum[u] = max(sum[u], dpU[u] + 1);
    else
      sum[u] = max(sum[u], dp[v] + 1);
  }
  pair<long long, long long> mx1 = {-0x3f3f3f3f, -1}, mx2 = {-0x3f3f3f3f, -1};
  if (s.count(u)) mx1 = {-1, -1};
  for (auto v : adj[u]) {
    pair<long long, long long> tmp;
    if (par == v)
      tmp = {dpU[u], v};
    else
      tmp = {dp[v], v};
    if (tmp.first > mx1.first) {
      mx2 = mx1;
      mx1 = tmp;
    } else if (tmp.first > mx2.first) {
      mx2 = tmp;
    }
  }
  for (auto v : adj[u]) {
    if (v == par) continue;
    if (v != mx1.second) {
      dpU[v] = mx1.first + 1;
    } else
      dpU[v] = mx2.first + 1;
  }
  for (auto v : adj[u]) {
    if (v != par) dfs_up(v, u);
  }
}
void solve() {
  cin >> n >> m >> d;
  dp = vector<long long>(n, -0x3f3f3f3f);
  for (long long i = (long long)(0); i < (long long)(m); i++) {
    long long a;
    cin >> a;
    --a;
    s.insert(a);
  }
  for (long long i = (long long)(1); i < (long long)(n); i++) {
    long long u, v;
    cin >> u >> v;
    --u, --v;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  dfs(0, -1);
  ;
  sum = vector<long long>(n);
  dpU = vector<long long>(n);
  dfs_up(0, -1);
  long long ans = 0;
  for (long long i = (long long)(0); i < (long long)(n); i++)
    if (sum[i] <= d) ans++;
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
