#include <bits/stdc++.h>
using namespace std;
const unsigned long long P = 239017, MaxN = 2100000, INF = 100000000;
int n, m;
vector<int> g[100100], dst[100100];
int a, b, up[100100], used[100100], need[100100];
pair<int, int> func[100100];
int r[100100];
int down(int v, int d) {
  used[v] = 1;
  r[v] = d;
  func[v].first = func[v].second = -1000000;
  if (need[v]) func[v].first = d;
  for (int i = 0; i < g[v].size(); ++i) {
    if (!used[g[v][i]]) {
      int ans = down(g[v][i], d + 1);
      dst[v].push_back(ans - d);
      if (ans >= func[v].first) {
        func[v].second = func[v].first;
        func[v].first = ans;
        continue;
      }
      if (ans > func[v].second) func[v].second = ans;
    } else
      dst[v].push_back(-1);
  }
  return need[v] ? max(func[v].first, d) : func[v].first;
}
void dfs(int v) {
  used[v] = 1;
  for (int i = 0; i < g[v].size(); ++i) {
    if (used[g[v][i]]) continue;
    if (dst[v][i] == func[v].first)
      up[g[v][i]] = max(up[v] + 1, func[v].second + 1);
    else
      up[g[v][i]] = max(up[v] + 1, func[v].first + 1);
    dfs(g[v][i]);
  }
}
int d;
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int i = 0; i < m; ++i) scanf("%d", &a), need[a] = 1;
  for (int i = 0; i < n - 1; ++i)
    scanf("%d%d", &a, &b), g[a].push_back(b), g[b].push_back(a);
  down(1, 0);
  for (int i = 1; i <= n; ++i)
    used[i] = 0, func[i].first -= r[i], func[i].second -= r[i];
  up[1] = -1000000;
  dfs(1);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (up[i] <= d && func[i].first <= d) ++cnt;
  }
  printf("%d", cnt);
  return 0;
}
