#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<vector<int> > gr;
vector<int> isBad, res, res2;
int ans;
void dfsFindRes(int v, int pr) {
  for (int i = 0; i < (int)gr[v].size(); ++i) {
    int v1 = gr[v][i];
    if (v1 == pr) continue;
    dfsFindRes(v1, v);
    int d = res[v1] + 1;
    if (d >= res[v]) {
      res2[v] = res[v];
      res[v] = d;
    } else if (res2[v] <= d)
      res2[v] = d;
  }
  if (isBad[v]) {
    if (res[v] <= 0) {
      res2[v] = res[v];
      res[v] = 0;
    } else if (res2[v] <= 0)
      res2[v] = 0;
  }
}
void dfsFindAns(int v, int pr, int curd) {
  if (max(curd, res[v]) <= d) ans++;
  for (int i = 0; i < (int)gr[v].size(); ++i) {
    int v1 = gr[v][i];
    if (v1 == pr) continue;
    int newd = res[v];
    if (newd == res[v1] + 1) newd = res2[v];
    newd++;
    newd = max(newd, curd + 1);
    dfsFindAns(v1, v, newd);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  gr.assign(n, vector<int>());
  isBad.assign(n, 0);
  for (int i = 0; i < m; ++i) {
    int x;
    scanf("%d", &x);
    isBad[x - 1] = 1;
  }
  for (int i = 1; i < n; ++i) {
    int v1, v2;
    scanf("%d%d", &v1, &v2);
    --v1;
    --v2;
    gr[v1].push_back(v2);
    gr[v2].push_back(v1);
  }
  res.assign(n, -1000000000);
  res2.assign(n, -1000000000);
  dfsFindRes(0, -1);
  ans = 0;
  dfsFindAns(0, -1, -1000000000);
  printf("%d\n", ans);
  return 0;
}
