#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int MAXN = int(1e5) + 10;
vector<int> g[MAXN];
int n, m, d;
bool good[MAXN];
int ans = 0;
int max_depth[MAXN];
void pre_dfs(int v, int p) {
  max_depth[v] = -1;
  if (good[v]) max_depth[v] = 0;
  for (int i = 0; i < int(((int)(g[v]).size())); i++) {
    int to = g[v][i];
    if (to != p) {
      pre_dfs(to, v);
      if (max_depth[to] != -1)
        max_depth[v] = max(max_depth[v], max_depth[to] + 1);
    }
  }
}
void dfs(int v, int p, int max_dist) {
  if (max(max_depth[v], max_dist) <= d) ans++;
  int max_depth1 = -1;
  int max_depth2 = -1;
  for (int i = 0; i < int(((int)(g[v]).size())); i++) {
    int to = g[v][i];
    if (to == p) continue;
    if (max_depth[to] > max_depth1) {
      max_depth2 = max_depth1;
      max_depth1 = max_depth[to];
    } else if (max_depth[to] > max_depth2) {
      max_depth2 = max_depth[to];
    }
  }
  if (max_dist == -1 && good[v]) max_dist = 0;
  for (int i = 0; i < int(((int)(g[v]).size())); i++) {
    int to = g[v][i];
    if (to == p) continue;
    int ndist = (max_dist == -1) ? -1 : max_dist + 1;
    if (max_depth[to] == max_depth1) {
      if (max_depth2 != -1) ndist = max(ndist, max_depth2 + 2);
    } else {
      if (max_depth1 != -1) ndist = max(ndist, max_depth1 + 2);
    }
    dfs(to, v, ndist);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  memset(good, false, sizeof good);
  for (int i = 0; i < int(m); i++) {
    int p;
    scanf("%d", &p);
    p--;
    good[p] = true;
  }
  for (int i = 0; i < int(n - 1); i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  pre_dfs(0, -1);
  dfs(0, -1, -1);
  printf("%d\n", ans);
  return 0;
}
