#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000000")
using namespace std;
const long long int INF = 2e7;
vector<vector<long long int> > g;
long long int p[200000], ch[200000], can[200000];
void dfs(long long int id, long long int fr = -1) {
  p[id] = -INF;
  if (ch[id]) p[id] = 0;
  for (long long int i = 0; i < (long long int)g[id].size(); i++) {
    long long int to = g[id][i];
    if (to == fr) continue;
    dfs(to, id);
    p[id] = max(p[id], p[to] + 1);
  }
}
void dfs2(long long int id, long long int maxi, long long int d,
          long long int fr = -1) {
  long long int temp = max(maxi, p[id]);
  if (d >= temp) can[id]++;
  multiset<long long int, greater<long long int> > good;
  good.insert(maxi + 1);
  if (ch[id]) good.insert(1);
  for (long long int i = 0; i < (long long int)g[id].size(); i++) {
    long long int to = g[id][i];
    if (to == fr) continue;
    good.insert(p[to] + 2);
  }
  for (long long int i = 0; i < (long long int)g[id].size(); i++) {
    long long int to = g[id][i];
    if (to == fr) continue;
    good.erase(good.find(p[to] + 2));
    dfs2(to, *good.begin(), d, id);
    good.insert(p[to] + 2);
  }
}
int main() {
  long long int n, m, d;
  cin >> n >> m >> d;
  g.resize(n);
  long long int a, b;
  long long int fr = -1;
  memset(can, 0, sizeof can);
  memset(ch, 0, sizeof ch);
  for (long long int i = 0; i < m; i++) {
    long long int a;
    cin >> a;
    a--;
    if (!i) fr = a;
    ch[a]++;
  }
  if (fr == -1) {
    cout << n;
    return 0;
  }
  for (long long int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(fr);
  dfs2(fr, -INF, d);
  long long int num = 0;
  for (long long int i = 0; i < n; i++) {
    if (can[i]) num++;
  }
  cout << num;
}
