#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
int n, m, ans = 0, d, danger[100005], d1[100005], d2[100005];
vector<int> g[100005];
void dfs1(int v, int par = -1) {
  d1[v] = d2[v] = -inf;
  if (danger[v]) d1[v] = 0;
  for (int i = 0; i < (int)g[v].size(); i++) {
    int to = g[v][i];
    if (to != par) {
      dfs1(to, v);
      if (d1[to] + 1 >= d1[v]) {
        d2[v] = d1[v];
        d1[v] = d1[to] + 1;
      } else if (d1[to] + 1 > d2[v]) {
        d2[v] = d1[to] + 1;
      }
    }
  }
}
void dfs2(int v, int par, int up) {
  int cur = max(d1[v], up);
  if (cur != -inf && cur <= d) ans++;
  int pos = -1;
  for (int i = 0; i < (int)g[v].size() && pos == -1; i++) {
    int to = g[v][i];
    if (to != par) {
      if (d1[to] + 1 == d1[v]) {
        int tmp = max(up, d2[v]);
        if (tmp != -inf) tmp++;
        pos = to;
        dfs2(to, v, tmp);
      }
    }
  }
  for (int i = 0; i < (int)g[v].size(); i++) {
    int to = g[v][i];
    if (to != par && to != pos) {
      int tmp = max(up, d1[v]);
      if (tmp != -inf) tmp++;
      dfs2(to, v, tmp);
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0, x; i < m; i++) {
    scanf("%d", &x);
    x--;
    danger[x] = 1;
  }
  for (int i = 0, x, y; i < n - 1; i++) {
    scanf("%d%d", &x, &y);
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  if (d == 0) {
    int cnt = 0;
    for (int i = 0; i < n; i++) cnt += danger[i];
    if (cnt == 1)
      printf("1\n");
    else
      printf("0\n");
    return 0;
  }
  dfs1(0);
  dfs2(0, -1, -inf);
  printf("%d\n", ans);
  return 0;
}
