#include <bits/stdc++.h>
using namespace std;
int cur, n, m, d, ans, head[200005], f1[200005], f2[200005], dis[200005];
bool sign[200005];
struct EDGE {
  int t, next;
} e[200005];
void add(int a, int b) {
  cur++;
  e[cur].t = b;
  e[cur].next = head[a];
  head[a] = cur;
}
void DFS(int u, int fa) {
  if (sign[u]) {
    f1[u] = f2[u] = 0;
  }
  for (int h = head[u]; h != -1; h = e[h].next) {
    int v = e[h].t;
    if (v == fa) continue;
    DFS(v, u);
    if (f1[v] + 1 > f1[u]) {
      f2[u] = f1[u];
      f1[u] = f1[v] + 1;
    } else
      f2[u] = max(f2[u], f1[v] + 1);
  }
}
void DFS2(int u, int fa) {
  for (int h = head[u]; h != -1; h = e[h].next) {
    int v = e[h].t;
    if (v == fa) continue;
    if (f1[u] == f1[v] + 1)
      dis[v] = max(dis[u] + 1, f2[u] + 1);
    else
      dis[v] = max(dis[u] + 1, f1[u] + 1);
    DFS2(v, u);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  memset(head, -1, sizeof head);
  memset(f1, 128, sizeof f1);
  memset(f2, 128, sizeof f2);
  memset(dis, 128, sizeof dis);
  for (int i = 1; i <= m; i++) {
    int a;
    scanf("%d", &a);
    sign[a] = 1;
  }
  for (int i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    add(a, b);
    add(b, a);
  }
  DFS(1, 0);
  DFS2(1, 0);
  for (int i = 2; i <= n; i++)
    if (max(dis[i], f1[i]) <= d) ans++;
  if (f1[1] <= d) ans++;
  cout << ans;
  return 0;
}
