#include <bits/stdc++.h>
using namespace std;
int n, m, d, ans;
pair<int, int> best1[100003];
pair<int, int> best2[100003];
bool evil[100003];
vector<int> adj[100003];
pair<int, int> dfs1(int node, int dad) {
  best1[node] = best2[node] = pair<int, int>(-1, -1);
  if (evil[node]) best1[node] = pair<int, int>(0, node);
  for (int i = 0; i < adj[node].size(); i++)
    if (adj[node][i] != dad) {
      int to = adj[node][i];
      pair<int, int> tmp = dfs1(to, node);
      if (tmp == pair<int, int>(-1, -1)) continue;
      if (tmp.first + 1 >= best1[node].first) {
        best2[node] = best1[node];
        best1[node] = pair<int, int>(tmp.first + 1, to);
      } else if (tmp.first + 1 >= best2[node].first)
        best2[node] = pair<int, int>(tmp.first + 1, to);
    }
  return best1[node];
}
void dfs2(int node, int dad, int ust) {
  if (evil[node] && ust == 1 << 30) ust = 0;
  if (max(best1[node].first, ust) <= d)
    ans++;
  else if (ust == 1 << 30 && best1[node].first <= d)
    ans++;
  int ust2 = min(ust + 1, 1 << 30);
  for (int i = 0; i < adj[node].size(); i++)
    if (adj[node][i] != dad) {
      int to = adj[node][i];
      if (best1[node].first == -1)
        dfs2(to, node, ust2);
      else if (best2[node].first == -1) {
        if (to == best1[node].second)
          dfs2(to, node, ust2);
        else {
          if (ust2 == 1 << 30)
            dfs2(to, node, best1[node].first + 1);
          else
            dfs2(to, node, max(best1[node].first + 1, ust2));
        }
      } else {
        if (to == best1[node].second) {
          if (ust2 == 1 << 30)
            dfs2(to, node, best2[node].first + 1);
          else
            dfs2(to, node, max(best2[node].first + 1, ust2));
        } else {
          if (ust2 == 1 << 30)
            dfs2(to, node, best1[node].first + 1);
          else
            dfs2(to, node, max(best1[node].first + 1, ust2));
        }
      }
    }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0, x; i < m; i++) {
    scanf("%d", &x);
    evil[x] = true;
  }
  for (int i = 1, x, y; i < n; i++) {
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs1(1, 0);
  dfs2(1, 0, 1 << 30);
  printf("%d\n", ans);
  return 0;
}
