#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5143;
const long long Linf = 1e18 + 5413;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void umin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / __gcd(a, b) * b;
}
inline int read() {
  int res = 0;
  int neg;
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9' || ch == '-') {
      if (ch == '-')
        neg = -1;
      else
        neg = 1, res = ch - '0';
      break;
    }
  }
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9')
      res *= 10, res += ch - '0';
    else
      break;
  }
  return res * neg;
}
const int N = 1e5 + 5;
bool P[N];
vector<int> G[N];
int L[N], R[N];
inline void update(int &a, int b, int c) {
  if (b != -inf) umax(a, b + c);
}
int sub(int node, int pre) {
  R[node] = P[node] ? 0 : -inf;
  for (__typeof(G[node].begin()) it = G[node].begin(); it != G[node].end();
       it++) {
    int u = *it;
    if (u == pre) continue;
    update(R[node], sub(u, node), 1);
  }
  return R[node];
}
void dfs(int node, int pre) {
  vector<pair<int, int> > vals;
  for (__typeof(G[node].begin()) it = G[node].begin(); it != G[node].end();
       it++) {
    int u = *it;
    if (u == pre) continue;
    vals.push_back(pair<int, int>(R[u], u));
  }
  sort(vals.begin(), vals.end());
  reverse(vals.begin(), vals.end());
  for (__typeof(G[node].begin()) it = G[node].begin(); it != G[node].end();
       it++) {
    int u = *it;
    if (u == pre) continue;
    int &rev = L[u];
    rev = P[u] ? 0 : -inf;
    if (u != vals[0].second)
      update(rev, vals[0].first, 2);
    else if (vals.size() > 1)
      update(rev, vals[1].first, 2);
    update(rev, L[node], 1);
    dfs(u, node);
  }
}
int main() {
  int n = read();
  int m = read();
  int d = read();
  for (int(i) = (1); (i) <= (m); (i)++) {
    int x = read();
    P[x] = 1;
  }
  for (int(i) = (1); (i) <= (n - 1); (i)++) {
    int u = read();
    int v = read();
    G[u].push_back(v);
    G[v].push_back(u);
  }
  sub(1, -1);
  L[1] = P[1] ? 0 : -inf;
  dfs(1, -1);
  int answer = 0;
  for (int(i) = (1); (i) <= (n); (i)++)
    if (max(L[i], R[i]) <= d) answer++;
  cout << answer << endl;
  cerr << "L[3]"
       << ":" << (L[3]) << endl;
  cerr << "R[3]"
       << ":" << (R[3]) << endl;
  return 0;
}
