#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5143;
const long long Linf = 1e18 + 5413;
const double eps = 1e-15;
const double pi = acos(-1);
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 = 0LL;
  int neg;
  while (1) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9' || ch == '-') {
      if (ch == '-')
        neg = -1;
      else
        neg = 1, res = ch - '0';
      break;
    }
  }
  while (1) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9')
      res *= 10, res += ch - '0';
    else
      break;
  }
  return res * neg;
}
const int N = 171717;
int depth[N], F[N];
vector<int> G[N];
bool good[N];
void dfs(int node, int pre) {
  depth[node] = depth[pre] + 1;
  for (__typeof(G[node].begin()) it = G[node].begin(); it != G[node].end();
       it++) {
    int u = *it;
    if (u == pre) continue;
    dfs(u, node);
  }
}
int main() {
  int n = read(), k = read(), d = read();
  for (int(i) = (1); (i) <= (k); (i)++) {
    int u = read();
    good[u] = true;
  }
  for (int(i) = (1); (i) <= (n - 1); (i)++) {
    int u = read(), v = read();
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  int d1 = -1, d2 = -1;
  int max_depth = 0;
  for (int(i) = (1); (i) <= (n); (i)++)
    if (good[i] && max_depth < depth[i]) {
      d1 = i;
      max_depth = depth[i];
    }
  dfs(d1, 0);
  max_depth = 0;
  for (int(i) = (1); (i) <= (n); (i)++)
    if (good[i] && max_depth < depth[i]) {
      d2 = i;
      max_depth = depth[i];
    }
  for (int(i) = (1); (i) <= (n); (i)++) umax(F[i], depth[i]);
  dfs(d2, 0);
  for (int(i) = (1); (i) <= (n); (i)++) umax(F[i], depth[i]);
  int res = 0;
  for (int(i) = (1); (i) <= (n); (i)++)
    if (F[i] - 1 <= d) res++;
  0;
  0;
  for (int(i) = (1); (i) <= (n); (i)++) {
    0;
  }
  cout << res << endl;
  return 0;
}
