#include <bits/stdc++.h>
using namespace std;
const int INF = ~0u >> 1;
int dp[101000][2];
int pre[101000][2];
int n, m, d;
struct Edge {
  int v, next;
} g[201000];
int head[101000], tot;
int cnt;
void add_edge(int u, int v) {
  g[tot].v = v;
  g[tot].next = head[u];
  head[u] = tot++;
}
void dfs(int u, int fa) {
  for (int p = head[u]; ~p; p = g[p].next) {
    if (g[p].v == fa) continue;
    int v = g[p].v;
    dfs(v, u);
    if (dp[v][0] + 1 > dp[u][1]) {
      dp[u][1] = dp[v][0] + 1;
      pre[u][1] = v;
      if (dp[u][1] > dp[u][0]) {
        swap(dp[u][1], dp[u][0]);
        swap(pre[u][1], pre[u][0]);
      }
    }
  }
}
void dfs2(int u, int fa, int dis) {
  if (dis > d) return;
  if (dp[u][0] <= d) cnt++;
  int d1 = max(dis, dp[u][0]) + 1;
  int d2 = max(dis, dp[u][1]) + 1;
  for (int p = head[u]; ~p; p = g[p].next) {
    if (g[p].v == fa) continue;
    int v = g[p].v;
    if (pre[u][0] == v)
      dfs2(v, u, d2);
    else
      dfs2(v, u, d1);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  int x;
  for (int i = (1); i < (n + 1); i++) dp[i][0] = dp[i][1] = -10000000;
  memset(head, -1, sizeof(head));
  for (int i = (1); i < (m + 1); i++) scanf("%d", &x), dp[x][0] = 0;
  int a, b;
  for (int i = (1); i < (n); i++) {
    scanf("%d%d", &a, &b);
    add_edge(a, b);
    add_edge(b, a);
  }
  dfs(1, -1);
  dfs2(1, -1, -10000000);
  printf("%d\n", cnt);
  return 0;
}
