#include <bits/stdc++.h>
using namespace std;
int n, m, d;
int p1, p2, p3;
vector<int> edge[100005];
bool damage[100005];
int dist[3][100005];
void dfs(int now, int last, int id, int dis) {
  dist[id][now] = dis;
  for (int i = 0; i < edge[now].size(); i++) {
    int y = edge[now][i];
    if (y != last) {
      dfs(y, now, id, dis + 1);
    }
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    a--;
    damage[a] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  for (int i = 0; i < n; i++) {
    if (damage[i]) {
      p1 = i;
      break;
    }
  }
  dfs(p1, -1, 0, 0);
  p2 = p1;
  for (int i = 0; i < n; i++) {
    if (damage[i] && dist[0][i] > dist[0][p2]) {
      p2 = i;
    }
  }
  dfs(p2, -1, 1, 0);
  p3 = p2;
  for (int i = 0; i < n; i++) {
    if (damage[i] && dist[1][i] > dist[1][p3]) {
      p3 = i;
    }
  }
  dfs(p3, -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;
  return 0;
}
