#include <bits/stdc++.h>
using namespace std;
queue<pair<int, int> > ygy;
vector<int> road[100005];
int n, m, d;
int app[100005];
int x, y;
int dep[100005][3];
int go[100005];
int main() {
  cin >> n >> m >> d;
  for (int i = 1; i <= m; i++) cin >> app[i];
  for (int i = 1; i < n; i++)
    cin >> x >> y, road[x].push_back(y), road[y].push_back(x);
  ygy.push(pair<int, int>(1, 0));
  while (ygy.size()) {
    pair<int, int> op = ygy.front();
    ygy.pop();
    if (go[op.first]) continue;
    go[op.first] = 1;
    dep[op.first][0] = op.second;
    for (auto nex : road[op.first])
      ygy.push(pair<int, int>(nex, op.second + 1));
  }
  int maxp = 0;
  for (int i = 1; i <= m; i++)
    if (dep[maxp][0] < dep[app[i]][0]) maxp = app[i];
  ygy.push(pair<int, int>(maxp, 0));
  memset(go, 0, sizeof(go));
  while (ygy.size()) {
    pair<int, int> op = ygy.front();
    ygy.pop();
    if (go[op.first]) continue;
    go[op.first] = 1;
    dep[op.first][1] = op.second;
    for (auto nex : road[op.first])
      ygy.push(pair<int, int>(nex, op.second + 1));
  }
  maxp = 0;
  for (int i = 1; i <= m; i++)
    if (dep[maxp][1] < dep[app[i]][1]) maxp = app[i];
  ygy.push(pair<int, int>(maxp, 0));
  memset(go, 0, sizeof(go));
  while (ygy.size()) {
    pair<int, int> op = ygy.front();
    ygy.pop();
    if (go[op.first]) continue;
    go[op.first] = 1;
    dep[op.first][2] = op.second;
    for (auto nex : road[op.first])
      ygy.push(pair<int, int>(nex, op.second + 1));
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (dep[i][1] <= d && dep[i][2] <= d) ans++;
  cout << ans;
}
