#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
struct NodeInfo {
  int node1 = -1;
  int dist1 = -1;
  int node2 = -1;
  int dist2 = -1;
};
int n, m, d;
int p[N];
int parent[N];
int depth[N];
bool isInfected[N];
vector<int> graph[N];
NodeInfo dp[N];
NodeInfo longestLCA;
int longestLCANode = -1;
NodeInfo emptyNode;
void dfs(int v) {
  set<pair<int, int>> st;
  if (isInfected[v]) {
    st.insert({-1, v});
  }
  for (auto x : graph[v]) {
    if (parent[v] == x) continue;
    depth[x] = depth[v] + 1;
    parent[x] = v;
    dfs(x);
    if (dp[x].dist1 >= dp[x].dist2) {
      if (dp[x].node1 != -1) st.insert({dp[x].dist1, dp[x].node1});
    } else {
      if (dp[x].node2 != -1) st.insert({dp[x].dist2, dp[x].node2});
    }
  }
  auto iter = st.end();
  if ((int)st.size() > 0) {
    --iter;
    dp[v].node1 = iter->second;
    dp[v].dist1 = iter->first + 1;
  }
  if ((int)st.size() > 1) {
    --iter;
    dp[v].node2 = iter->second;
    dp[v].dist2 = iter->first + 1;
  }
  if ((dp[v].node2 != -1 || (m == 1 && p[0] == v)) &&
      dp[v].dist1 + dp[v].dist2 > longestLCA.dist1 + longestLCA.dist2) {
    longestLCA = dp[v];
    longestLCANode = v;
  }
}
void printDP() {
  cout << "\n\n";
  for (int i = 1; i <= n; ++i) {
    printf("%d: (%d,%d), (%d,%d)\n", i, dp[i].node1, dp[i].dist1, dp[i].node2,
           dp[i].dist2);
  }
  printf("Best LCA: %d\n", longestLCANode);
  printf("Best: (%d, %d), (%d, %d)\n\n", longestLCA.node1, longestLCA.dist1,
         longestLCA.node2, longestLCA.dist2);
}
pair<int, int> getMiddle() {
  if (m == 1 && longestLCA.node2 != -1)
    while (1)
      ;
  if (m == 1 && longestLCANode != longestLCA.node1)
    while (1)
      ;
  if (longestLCA.node2 == -1) {
    return {longestLCANode, -1};
  }
  int pathLen = longestLCA.dist1 + longestLCA.dist2;
  int v = longestLCA.node1;
  int cpath = 0;
  while (1) {
    if (pathLen % 2 == 1) {
      if (cpath == pathLen / 2) {
        return {v, parent[v]};
      }
    } else {
      if (cpath == pathLen / 2) return {v, -1};
    }
    cpath++;
    v = parent[v];
  }
}
bool visited[N];
int res = 0;
void countNodes(int v, int curDist) {
  if (visited[v]) return;
  res++;
  visited[v] = true;
  if (curDist == 0) return;
  for (auto x : graph[v]) {
    countNodes(x, curDist - 1);
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 0; i < m; ++i) {
    cin >> p[i];
    isInfected[p[i]] = true;
  }
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  parent[1] = 0;
  depth[1] = 0;
  dfs(1);
  pair<int, int> middleNodes = getMiddle();
  if (middleNodes.second != -1 && m > 1) visited[middleNodes.second] = true;
  int pathLen = longestLCA.dist1 + longestLCA.dist2;
  int traversePath =
      d - pathLen / 2 - ((middleNodes.second != -1 && m != 1) ? 1 : 0);
  if (traversePath < 0) {
    cout << "0\n";
    return 0;
  }
  countNodes(middleNodes.first, traversePath);
  if (middleNodes.second != -1) {
    visited[middleNodes.second] = false;
    countNodes(middleNodes.second, traversePath);
  }
  cout << res << "\n";
  return 0;
}
