#include <bits/stdc++.h>
using namespace std;
int m, n, dist;
int is[111111], bad[111111];
int deep[111111];
vector<int> g[111111];
int an;
void dfs(int u, int pa) {
  for (int i = 0; i < g[u].size(); ++i) {
    int v = g[u][i];
    if (v != pa) {
      dfs(v, u);
      if (is[v]) deep[u] = max(deep[u], deep[v] + 1);
      is[u] |= is[v];
    }
  }
  is[u] |= bad[u];
}
void go(int u, int d, int pa) {
  if (d <= dist && deep[u] <= dist) ++an;
  if (bad[u]) d = max(d, 0);
  vector<int> pre, suf, ver;
  for (int i = 0; i < g[u].size(); ++i) {
    int v = g[u][i];
    if (v != pa) {
      if (!is[v])
        pre.push_back(-1);
      else
        pre.push_back(deep[v] + 2);
      ver.push_back(v);
    }
  }
  suf = pre;
  for (int i = 1; i < pre.size(); ++i) {
    pre[i] = max(pre[i], pre[i - 1]);
  }
  for (int i = pre.size() - 2; i >= 0; --i) {
    suf[i] = max(suf[i], suf[i + 1]);
  }
  for (int i = 0; i < ver.size(); ++i) {
    int v = ver[i];
    int nxtd = -1;
    if (i > 0) nxtd = max(nxtd, pre[i - 1]);
    if (i < ver.size() - 1) nxtd = max(nxtd, suf[i + 1]);
    if (d != -1) nxtd = max(nxtd, d + 1);
    go(v, nxtd, u);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &dist);
  for (int i = 1; i <= m; ++i) {
    int t;
    scanf("%d", &t);
    bad[t] = 1;
  }
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1);
  go(1, -1, -1);
  printf("%d", an);
  return 0;
}
