#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
bool mark1[maxn], mark2[maxn], b[maxn];
vector<int> adj[maxn];
int d1[maxn], d2[maxn];
int n, m, d, f, e1, e2, ans;
void input() {
  cin >> n >> m >> d;
  int v, u;
  for (int i = 0; i < m; i++) {
    cin >> f;
    f--;
    b[f] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> v >> u;
    v--;
    u--;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
}
void dfs(int x) {
  mark1[x] = 1;
  for (int i = 0; i < adj[x].size(); i++) {
    int child = adj[x][i];
    if (!mark1[child]) {
      d1[child] = d1[x] + 1;
      dfs(child);
    }
  }
}
void dfs2(int x) {
  mark2[x] = 1;
  for (int i = 0; i < adj[x].size(); i++) {
    int child = adj[x][i];
    if (!mark2[child]) {
      d2[child] = d2[x] + 1;
      dfs2(child);
    }
  }
}
int main() {
  input();
  dfs(f);
  e1 = e2 = f;
  for (int i = 0; i < n; i++)
    if (d1[i] > d1[e1] && b[i]) e1 = i;
  for (int i = 0; i < n; i++) {
    mark1[i] = 0;
    d1[i] = 0;
  }
  dfs(e1);
  for (int i = 0; i < n; i++)
    if (d1[i] > d1[e2] && b[i]) e2 = i;
  dfs2(e2);
  for (int i = 0; i < n; i++)
    if (max(d1[i], d2[i]) <= d) ans++;
  cout << ans;
  return 0;
}
