#include <bits/stdc++.h>
using namespace std;
void deba(int* a, int n) {
  cerr << "| ";
  for (int i = 0; i < (n); i++) cerr << a[i] << " ";
  cerr << "|" << endl;
}
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = 1 << 30;
vector<int> gn[123456];
int stat[123456];
int d1[123456];
int d2[123456];
int mx, mxI, len;
bool paint(int u, int unot) {
  int& ret = stat[u];
  for (int i = 0; i < (gn[u].size()); i++) {
    if (gn[u][i] != unot) {
      ret |= paint(gn[u][i], u);
    }
  }
  return ret;
}
void dfs(int u, int unot, int len, int* d) {
  d[u] = len;
  if (len > mx) {
    mx = len;
    mxI = u;
  }
  for (int i = 0; i < (gn[u].size()); i++) {
    if (gn[u][i] != unot && stat[gn[u][i]]) {
      dfs(gn[u][i], u, len + 1, d);
    }
  }
}
void dfsc(int u, int unot, int l) {
  if (l <= len) stat[u] = 4;
  for (int i = 0; i < (gn[u].size()); i++) {
    if (gn[u][i] != unot) {
      dfsc(gn[u][i], u, l + 1);
    }
  }
}
int main() {
  int n, m, d;
  scanf("%d %d %d", &n, &m, &d);
  ;
  int beg;
  for (int i = 0; i < (m); i++) {
    int a;
    scanf("%d", &a);
    ;
    stat[a] = 1;
    beg = a;
  }
  for (int i = 0; i < (n - 1); i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    ;
    gn[a].push_back(b);
    gn[b].push_back(a);
  }
  paint(beg, 0);
  mx = -1;
  dfs(beg, 0, 0, d2);
  mx = -1;
  int mxI2 = mxI;
  dfs(mxI2, 0, 0, d2);
  dfs(mxI, 0, 0, d1);
  vector<int> center;
  for (int u = (1); u <= (n); u++) {
    if (stat[u] && d1[u] + d2[u] <= mx && abs(d1[u] - d2[u]) <= 1)
      center.push_back(u);
  }
  len = max(d1[center[0]], d2[center[0]]);
  if (len > d)
    cout << 0 << endl;
  else {
    len = d - len;
    for (int i = 0; i < (center.size()); i++) dfsc(center[i], 0, 0);
    int cnt = 0;
    for (int i = (1); i <= (n); i++)
      if (stat[i] == 4) cnt++;
    cout << cnt << endl;
  }
  return 0;
}
