#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, d, tmp;
bool flag[N];
vector<int> V[N];
int f[2][N];
void dfs(int u, int p, int d, int f[]) {
  f[u] = d;
  for (int i = 0; i < V[u].size(); i++)
    if (V[u][i] != p) dfs(V[u][i], u, d + 1, f);
}
int main() {
  while (~scanf("%d %d %d", &n, &m, &d)) {
    memset(flag, 0, sizeof flag);
    for (int i = 0; i < m; i++) {
      scanf("%d", &tmp);
      tmp--;
      flag[tmp] = 1;
    }
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      scanf("%d %d", &u, &v);
      u--, v--;
      V[u].push_back(v);
      V[v].push_back(u);
    }
    dfs(0, -1, 0, f[0]);
    int u;
    for (int i = 0; i < n; i++)
      if (flag[i]) u = i;
    for (int i = 0; i < n; i++)
      if (flag[i] && f[0][i] > f[0][u]) u = i;
    dfs(u, -1, 0, f[0]);
    for (int i = 0; i < n; i++)
      if (flag[i] && f[0][i] > f[0][u]) u = i;
    dfs(u, -1, 0, f[1]);
    int ans = 0;
    for (int i = 0; i < n; i++)
      if (f[0][i] <= d && f[1][i] <= d) ans++;
    printf("%d\n", ans);
  }
  return 0;
}
