#include <bits/stdc++.h>
using namespace std;
int n, m, d, dist[100010], up[100010], dd[100010];
vector<int> head[100010];
void DFS(int u, int pa) {
  if (dd[u])
    dist[u] = 0;
  else
    dist[u] = -1;
  for (int i = 0; i <= (int)head[u].size() - 1; i++) {
    int v = head[u][i];
    if (v != pa) {
      DFS(v, u);
      if (dist[v] != -1) dist[u] = max(dist[u], dist[v] + 1);
    }
  }
}
void Cal(int u, int pa) {
  int maxdist = -1;
  for (int i = 0; i <= (int)head[u].size() - 1; i++) {
    int v = head[u][i];
    if (v == pa) continue;
    if (maxdist != -1) up[v] = max(up[v], maxdist + 2);
    if (dist[v] != -1) maxdist = max(maxdist, dist[v]);
  }
  maxdist = -1;
  for (int i = (int)head[u].size() - 1; i >= 0; i--) {
    int v = head[u][i];
    if (v == pa) continue;
    if (maxdist != -1) up[v] = max(up[v], maxdist + 2);
    if (dist[v] != -1) maxdist = max(maxdist, dist[v]);
  }
  for (int i = 0; i <= (int)head[u].size() - 1; i++) {
    int v = head[u][i];
    if (v == pa) continue;
    if (up[u] != -1) up[v] = max(up[v], up[u] + 1);
    if (dd[v]) up[v] = max(up[v], 0);
    Cal(v, u);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 1; i <= m; i++) {
    int u;
    scanf("%d", &u);
    dd[u] = 1;
  }
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    head[u].push_back(v);
    head[v].push_back(u);
  }
  DFS(1, 0);
  for (int _ = 1; _ <= n; _++) up[_] = -1;
  ;
  if (dd[1]) up[1] = 0;
  Cal(1, 0);
  int res = 0;
  for (int i = 1; i <= n; i++) res += max(dist[i], up[i]) <= d;
  cout << res;
  return 0;
}
