#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 5;
int n, m, d;
vector<int> g[N];
int dist[3][N];
int good[N];
void dfs(int v, int p, int id, int depth) {
  dist[id][v] = depth;
  for (int u : g[v]) {
    if (u != p) {
      dfs(u, v, id, depth + 1);
    }
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    int foo;
    cin >> foo;
    good[foo - 1] = 1;
  }
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int x = 0;
  for (x = 0; x < n; x++) {
    if (good[x]) {
      break;
    }
  }
  dfs(x, -1, 0, 0);
  int y = x;
  for (int i = 0; i < n; i++) {
    if (good[i] && dist[0][i] > dist[0][y]) {
      y = i;
    }
  }
  dfs(y, -1, 1, 0);
  int z = y;
  for (int i = 0; i < n; i++) {
    if (good[i] && dist[1][i] > dist[1][z]) {
      z = i;
    }
  }
  dfs(z, -1, 2, 0);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (dist[1][i] <= d && dist[2][i] <= d) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
