#include <bits/stdc++.h>
using namespace std;
bool af[100000];
pair<pair<int, int>, pair<int, int> > ld[100000];
int ltd[100000];
vector<int> e[100000];
int max(int a, int b) { return a > b ? a : b; }
pair<pair<int, int>, pair<int, int> > update(
    pair<pair<int, int>, pair<int, int> > tmp, pair<int, int> p) {
  if (p.first >= tmp.first.first) {
    tmp.second = tmp.first;
    tmp.first = p;
  } else if (p.first > tmp.second.first)
    tmp.second = p;
  return tmp;
}
int dfs1(int v, int p) {
  if (af[v]) ld[v] = update(ld[v], pair<int, int>(0, v));
  for (int i = 0; i < e[v].size(); i++) {
    int u = e[v][i];
    if (u == p) continue;
    ld[v] = update(ld[v], pair<int, int>(dfs1(u, v) + 1, u));
  }
  return ld[v].first.first;
}
void dfs2(int v, int p, int d) {
  ltd[v] = max(ld[v].first.first, d);
  for (int i = 0; i < e[v].size(); i++) {
    int u = e[v][i];
    if (u == p) continue;
    int nxt;
    if (ld[v].first.second == u)
      nxt = max(d, ld[v].second.first) + 1;
    else
      nxt = max(d, ld[v].first.first) + 1;
    dfs2(u, v, nxt);
  }
}
int main() {
  int n, m, d;
  int i;
  scanf("%d %d %d", &n, &m, &d);
  for (i = 0; i < n; i++) {
    af[i] = false;
    ld[i] = pair<pair<int, int>, pair<int, int> >(
        pair<int, int>(-100000000, -1), pair<int, int>(-100000000, -1));
    ltd[i] = -100000000;
  }
  for (i = 0; i < m; i++) {
    int v;
    scanf("%d", &v);
    af[v - 1] = true;
  }
  for (i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs1(0, -1);
  dfs2(0, -1, -100000000);
  int ans = 0;
  for (i = 0; i < n; i++)
    if (ltd[i] <= d) ans++;
  printf("%d\n", ans);
  return 0;
}
