#include <bits/stdc++.h>
using namespace std;
vector<int> ver[1000001];
vector<int> edge[100001];
queue<pair<int, int> > q;
int a, m, t;
int maxp;
int mm[1000001];
int v[100001];
int d[1000001][5];
void add(int x, int y) {
  ver[x].push_back(y);
  ver[y].push_back(x);
}
void dfs(int x, int type) {
  v[x] = 1;
  for (int i = 0; i < ver[x].size(); i++) {
    int y = ver[x][i];
    if (v[y]) continue;
    d[y][type] = d[x][type] + 1;
    if (d[y][type] > d[maxp][type] && mm[y] == 1) {
      maxp = y;
    }
    dfs(y, type);
  }
}
int main() {
  int o;
  memset(d, 0, sizeof(d));
  cin >> a >> m >> t;
  int x;
  int l;
  for (int i = 1; i <= m; i++) {
    cin >> l;
    mm[l] = 1;
    o = l;
  }
  int ans = 0, y;
  for (int i = 1; i < a; i++) {
    cin >> x >> y;
    add(x, y);
  }
  maxp = o;
  d[o][1] = 1;
  memset(v, 0, sizeof(v));
  dfs(o, 1);
  d[maxp][2] = 1;
  memset(v, 0, sizeof(v));
  dfs(maxp, 2);
  d[maxp][3] = 1;
  memset(v, 0, sizeof(v));
  dfs(maxp, 3);
  for (int i = 1; i <= a; i++) {
    if (d[i][2] <= t + 1 && d[i][3] <= t + 1) ans++;
  }
  cout << ans;
  return 0;
}
