#include <bits/stdc++.h>
using namespace std;
const int INF = -1000000000;
const int N = 100000 + 5;
pair<int, int> subtree[N];
bool marked[N];
int parent[N];
int outside[N];
bool vis[N];
int n, m, d;
vector<vector<int> > graph;
int dfs_subtree(int root) {
  vis[root] = true;
  pair<int, int> &p = subtree[root];
  p.first = p.second = INF;
  if (marked[root]) p.first = 0;
  for (int x = 0; x < graph[root].size(); ++x) {
    int child = graph[root][x];
    if (!vis[child]) {
      parent[child] = root;
      int dd = dfs_subtree(child) + 1;
      if (dd > p.first) {
        p.second = p.first;
        p.first = dd;
      } else if (dd > p.second) {
        p.second = dd;
      }
    }
  }
  return subtree[root].first;
}
void dfs_outer(int root) {
  vis[root] = true;
  for (int x = 0; x < graph[root].size(); ++x) {
    int child = graph[root][x];
    if (!vis[child]) {
      int d1 = subtree[root].first;
      int d2 = subtree[root].second;
      int &target = outside[child];
      target = outside[root] + 1;
      if (subtree[child].first + 1 == d1)
        target = max(target, d2 + 1);
      else
        target = max(target, d1 + 1);
      dfs_outer(child);
    }
  }
}
int main() {
  cin >> n >> m >> d;
  memset(marked, 0, sizeof marked);
  memset(parent, -1, sizeof parent);
  for (int i = 0; i < m; ++i) {
    int node;
    cin >> node;
    --node;
    marked[node] = true;
  }
  graph.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  int root = 0;
  memset(vis, 0, sizeof vis);
  dfs_subtree(root);
  memset(vis, 0, sizeof vis);
  outside[root] = INF;
  dfs_outer(root);
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int d1 = subtree[i].first;
    int d2 = outside[i];
    if (max(d1, d2) <= d) {
      ans++;
    }
  }
  cout << ans << endl;
}
