#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
struct Edge {
  int to, next;
};
Edge edge[MAXN << 1];
int dp[MAXN][3], head[MAXN], isEvil[MAXN];
inline void addEdge(int k, int u, int v) {
  edge[k].to = v, edge[k].next = head[u], head[u] = k;
}
void dfsSon(int fa, int u) {
  dp[u][0] = dp[u][1] = 0;
  for (int i = head[u]; ~i; i = edge[i].next) {
    int v = edge[i].to, tmp = 0;
    if (fa == v) continue;
    dfsSon(u, v);
    if (isEvil[v] || dp[v][0]) tmp = 1 + dp[v][0];
    if (tmp >= dp[u][0]) {
      dp[u][1] = dp[u][0];
      dp[u][0] = tmp;
    } else if (tmp > dp[u][1])
      dp[u][1] = tmp;
  }
}
void dfsFa(int fa, int u) {
  for (int i = head[u]; ~i; i = edge[i].next) {
    int v = edge[i].to, tmp = 0;
    if (fa == v) continue;
    if (dp[v][0] + 1 == dp[u][0] && (dp[v][0] || isEvil[v]))
      tmp = max(dp[u][2], dp[u][1]);
    else
      tmp = max(dp[u][0], dp[u][2]);
    if (tmp || isEvil[u]) tmp++;
    dp[v][2] = tmp;
    dfsFa(u, v);
  }
}
int main() {
  int n, m, d, u, v, k(0), ans(0);
  memset(head, -1, sizeof head);
  memset(isEvil, 0, sizeof isEvil);
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0; i < m; i++) scanf("%d", &u), isEvil[u] = 1;
  for (int i = 0; i < n - 1; i++)
    scanf("%d%d", &u, &v), addEdge(k++, u, v), addEdge(k++, v, u);
  dfsSon(0, 1), dfsFa(0, 1);
  for (int i = 1; i <= n; i++)
    if (max(dp[i][0], dp[i][2]) <= d) ans++;
  printf("%d\n", ans);
  return 0;
}
