#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, m, D[MAXN], cnt, L;
vector<int> adj[MAXN];
bool A[MAXN];
int dfs1(int v, int pr) {
  int r = -1;
  if (A[v]) r = 0;
  for (int i = 0; i < adj[v].size(); i++) {
    int p = adj[v][i];
    if (p == pr) continue;
    int t = dfs1(p, v);
    if (t != -1) r = max(r, t + 1);
  }
  D[v] = r;
  return r;
}
void dfs2(int v, int pr, int d) {
  if (d <= L && D[v] <= L) cnt++;
  if (A[v] && d == -1) d = 0;
  int mx1 = -1, mx2 = -1;
  for (int i = 0; i < adj[v].size(); i++) {
    int p = adj[v][i];
    if (p == pr) continue;
    int t = D[p];
    if (t == -1) continue;
    ++t;
    if (t > mx1) {
      mx2 = mx1;
      mx1 = t;
    } else if (t > mx2)
      mx2 = t;
  }
  for (int i = 0; i < adj[v].size(); i++) {
    int p = adj[v][i];
    if (p == pr) continue;
    int t = D[p];
    int x = mx1;
    if (t != -1 && t + 1 == mx1) x = mx2;
    if (x != -1) x++;
    if (d != -1) x = max(x, d + 1);
    dfs2(p, v, x);
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &L);
  for (int i = 0; i < (m); i++) {
    int a;
    scanf("%d", &a), A[a - 1] = true;
  }
  for (int i = (0); i <= (n - 2); i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--, v--;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  dfs1(0, -1);
  dfs2(0, -1, -1);
  printf("%d\n", cnt);
  return 0;
}
