#include <bits/stdc++.h>
using namespace std;
const int maxn = 100004;
const int inf = 1e9;
int m, n, d;
int p[maxn];
bool vis[maxn];
int f1[maxn], f2[maxn];
int g1[maxn], g2[maxn];
vector<int> edge[maxn];
int ans;
void dfs(int u, int fa) {
  if (!vis[u]) f1[u] = f2[u] = -inf;
  for (int i = 0; i < (int)edge[u].size(); i++) {
    int v = edge[u][i];
    if (v == fa) continue;
    dfs(v, u);
    if (f2[u] < f1[v] + 1) {
      f2[u] = f1[v] + 1;
      g2[u] = v;
      if (f2[u] > f1[u]) {
        swap(f1[u], f2[u]);
        swap(g1[u], g2[u]);
      }
    }
  }
}
void cal(int u, int fa, int val) {
  ans += max(val, f1[u]) <= d;
  for (int i = 0; i < (int)edge[u].size(); i++) {
    int v = edge[u][i];
    if (v == fa) continue;
    int vv;
    if (v == g1[u])
      vv = max(val, f2[u]) + 1;
    else
      vv = max(val, f1[u]) + 1;
    cal(v, u, vv);
  }
}
int main() {
  int i;
  scanf("%d%d%d", &n, &m, &d);
  for (i = 0; i < m; i++) {
    int tp;
    scanf("%d", &tp);
    vis[tp] = 1;
  }
  int x, y;
  for (i = 0; i < n - 1; i++) {
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  dfs(1, -1);
  cal(1, -1, -inf);
  printf("%d\n", ans);
  return 0;
}
