#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
int h[N];
bool mark[N], ans[N];
vector<int> g[N];
int n, m, d, D, R;
void dfs(int s, int p) {
  h[s] = h[p] + 1;
  ans[s] &= (h[s] <= d);
  if (mark[s] && h[s] > D) {
    D = h[s], R = s;
  }
  for (int i = 0; i < g[s].size(); i++) {
    int v = g[s][i];
    if (v == p) continue;
    dfs(v, s);
  }
}
int main() {
  scanf("%d", &n), scanf("%d", &m), scanf("%d", &d);
  int a, b;
  D = 0;
  h[0] = -1;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &R);
    mark[R] = true;
  }
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d", &a), scanf("%d", &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  memset(ans, true, sizeof(ans));
  dfs(R, 0);
  dfs(R, 0);
  dfs(R, 0);
  int res = 0;
  for (int i = 1; i <= n; i++) {
    if (ans[i]) res++;
  }
  printf("%d\n", res);
  return 0;
}
