#include <bits/stdc++.h>
using namespace std;
const int N = 1e5, oo = 1e9;
int n, m, d, p[N], up[N], down[N];
pair<int, int> mx[N];
vector<int> g[N];
bool with[N];
void DFS(int v, int p) {
  mx[v] = make_pair(-1, -1);
  for (int i = 0; i < g[v].size(); ++i) {
    int u = g[v][i];
    if (u == p) continue;
    DFS(u, v);
    down[v] = max(down[v], down[u] + 1);
    if (mx[v].first == -1 || down[u] > down[mx[v].first]) {
      mx[v].second = mx[v].first;
      mx[v].first = u;
    } else if (mx[v].second == -1 || down[u] > down[mx[v].second])
      mx[v].second = u;
  }
  if (with[v]) down[v] = max(down[v], 0);
}
void DFS1(int v, int p) {
  if (p != -1) {
    up[v] = max(up[v], up[p] + 1);
    if (mx[p].first == v) {
      if (mx[p].second != -1) up[v] = max(up[v], down[mx[p].second] + 2);
    } else
      up[v] = max(up[v], down[mx[p].first] + 2);
  }
  if (with[p]) up[v] = max(up[v], 1);
  for (int i = 0; i < g[v].size(); ++i)
    if (g[v][i] != p) DFS1(g[v][i], v);
}
int main(int argc, char **argv) {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &p[i]);
    --p[i];
    with[p[i]] = true;
  }
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < n; ++i) up[i] = down[i] = -oo;
  DFS(0, -1);
  DFS1(0, -1);
  int res = 0;
  for (int i = 0; i < n; ++i)
    if (max(up[i], down[i]) <= d) ++res;
  printf("%d\n", res);
  return 0;
}
