#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int inf = LONG_MAX;
const long long inf64 = LLONG_MAX;
const long double pi = 3.1415926535897932384626433832795;
bool c[200000];
int cc[200000], t[200000];
vector<int> b[200000];
int met = 0;
int most(int f) {
  met++;
  int res = f;
  int mmax = 0;
  queue<pair<int, int> > qu;
  qu.push(make_pair(0, f));
  cc[f] = met;
  while (qu.size()) {
    int val = qu.front().first;
    int pos = qu.front().second;
    qu.pop();
    if (c[pos] && val > mmax) mmax = val, res = pos;
    for (int i = 0; i < b[pos].size(); i++)
      if (cc[b[pos][i]] != met) {
        qu.push(make_pair(val + 1, b[pos][i]));
        cc[b[pos][i]] = met;
      }
  }
  return res;
}
void mark(int f, int d) {
  met++;
  queue<pair<int, int> > qu;
  qu.push(make_pair(0, f));
  cc[f] = met;
  while (qu.size()) {
    int val = qu.front().first;
    int pos = qu.front().second;
    qu.pop();
    if (val <= d) t[pos]++;
    for (int i = 0; i < b[pos].size(); i++)
      if (cc[b[pos][i]] != met) {
        qu.push(make_pair(val + 1, b[pos][i]));
        cc[b[pos][i]] = met;
      }
  }
}
int main() {
  int n, m, d;
  scanf("%d%d%d", &n, &m, &d);
  int from = 0;
  for (int i = 0; i < m; i++) {
    int j;
    scanf("%d", &j);
    j--;
    c[j] = true;
    from = j;
  }
  for (int i = 0; i < n - 1; i++) {
    int j1, j2;
    scanf("%d%d", &j1, &j2);
    j1--;
    j2--;
    b[j1].push_back(j2);
    b[j2].push_back(j1);
  }
  int t1 = most(from);
  int t2 = most(t1);
  mark(t1, d), mark(t2, d);
  int count = 0;
  for (int i = 0; i < n; i++)
    if (t[i] == 2) count++;
  cout << count;
  return 0;
}
