#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const string LN = "\n";
const double eps = 1e-9;
const double pi = acos(-1.0);
const int INF = (int)2e9 + 7;
const long long LINF = (long long)9e18 + 7;
bool insert(int k, int x1, int x2) { return (k >= x1 && k <= x2); }
const int MAXN = 60007;
const long long MOD = 1e9 + 7;
int n, m, d, ans = 0;
vector<int> g[100007];
bool bad[100007];
int d1[100007], d2[100007];
pair<int, int> pod[100007];
void sd(pair<int, int> &a, int b) {
  if (a.first == -INF) {
    a.first = b;
  } else {
    if (a.second == -INF) {
      a.second = b;
      if (a.second > a.first) swap(a.second, a.first);
    } else {
      if (a.first < b) {
        a.second = a.first;
        a.first = b;
      } else {
        a.second = max(a.second, b);
      }
    }
  }
}
int dfs(int v, int pred) {
  pod[v] = make_pair(-INF, -INF);
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to != pred) {
      int q = dfs(to, v);
      sd(pod[v], q);
    }
  }
  if (pod[v].first != -INF) pod[v].first++;
  if (pod[v].second != -INF) pod[v].second++;
  if (bad[v]) sd(pod[v], 0);
  if (pod[v].first != -INF)
    d1[v] = pod[v].first;
  else
    d1[v] = -INF;
  return d1[v];
}
void dfs2(int v, int pred) {
  if (pred != -1) {
    d2[v] = -INF;
    if (d2[pred] != -INF) d2[v] = d2[pred] + 1;
    if (d1[v] + 1 == pod[pred].first) {
      if (pod[pred].second != -INF) {
        d2[v] = max(d2[v], pod[pred].second + 1);
      }
    } else {
      if (pod[pred].first != -INF) {
        d2[v] = max(d2[v], pod[pred].first + 1);
      }
    }
  }
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to != pred) {
      dfs2(to, v);
    }
  }
}
const bool is_testing = 0;
int main() {
  srand(3252);
  if (is_testing) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    bad[--x] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(0, -1);
  d2[0] = -INF;
  dfs2(0, -1);
  for (int i = 0; i < n; i++)
    if (d1[i] <= d && d2[i] <= d) ans++;
  cout << ans;
}
