#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
vector<int> g[MAXN];
bool p[MAXN];
int d, ans;
int max1[MAXN], max2[MAXN];
void dfs(int v, int par = -1) {
  int i, to;
  if (p[v]) max1[v] = 0;
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i];
    if (to == par) continue;
    dfs(to, v);
  }
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i];
    if (to == par) continue;
    if (max1[to] != -1) {
      if (max1[to] >= max1[v]) {
        max2[v] = max1[v];
        max1[v] = max1[to] + 1;
        continue;
      }
      if (max1[to] >= max2[v]) max2[v] = max1[to] + 1;
    }
  }
}
void rec(int v, int par, int step) {
  int i, to;
  bool flag;
  flag = true;
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i];
    if (to == par) continue;
    if (max1[to] >= d) flag = false;
  }
  if (flag) ans++;
  if (!step) return;
  for (i = 0; i < g[v].size(); i++) {
    to = g[v][i];
    if (to == par) continue;
    if (max1[v] == -1000000) {
      rec(to, v, step - 1);
      continue;
    }
    if (max1[v] != max1[to] + 1) {
      if (max1[v] >= d) continue;
      rec(to, v, min(step - 1, d - max1[v] - 1));
      continue;
    }
    if (max2[v] == -1000000) {
      rec(to, v, step - 1);
      continue;
    }
    if (max2[v] >= d) continue;
    rec(to, v, min(step - 1, d - max2[v] - 1));
  }
}
int main() {
  int n, m, st, i, x, y;
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> d;
  memset(p, false, sizeof(p));
  for (i = 0; i < m; i++) {
    cin >> x;
    st = x;
    p[x] = true;
  }
  for (i = 0; i < n - 1; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    max1[i] = max2[i] = -1000000;
  }
  dfs(st);
  ans = 0;
  rec(st, -1, n);
  cout << ans << endl;
  return 0;
}
