#include <bits/stdc++.h>
using namespace std;
const int lim = 1000000000;
const int N = 100005;
vector<int> edge[N];
bool visit[N], FIND[N];
pair<int, int> f[N];
int g[N];
void up(pair<int, int> &a, int b) {
  if (b >= a.first) {
    a.second = a.first;
    a.first = b;
  } else
    a.second = max(a.second, b);
}
void dfs(int a) {
  visit[a] = true;
  f[a] = make_pair(-lim, -lim);
  g[a] = -lim;
  for (int i = 0; i < ((int)(edge[a]).size()); ++i) {
    int j = edge[a][i];
    if (visit[j]) continue;
    dfs(j);
    up(f[a], f[j].first + 1);
  }
  if (FIND[a]) up(f[a], 0);
}
void DFS(int a) {
  visit[a] = true;
  for (int i = 0; i < ((int)(edge[a]).size()); ++i) {
    int j = edge[a][i];
    if (visit[j]) continue;
    g[j] = max(g[j], g[a] + 1);
    if (f[a].first == f[j].first + 1)
      g[j] = max(g[j], f[a].second + 1);
    else
      g[j] = max(g[j], f[a].first + 1);
    DFS(j);
  }
}
int main() {
  int n, m, d;
  scanf("%d%d%d", &n, &m, &d);
  while (m--) {
    int x;
    scanf("%d", &x);
    FIND[x] = true;
  }
  for (int i = 1; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  dfs(1);
  memset(visit, 0, sizeof visit);
  DFS(1);
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    if (f[i].first <= d && g[i] <= d) ++ans;
  printf("%d\n", ans);
  return 0;
}
