#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, m, k, mon[100005], mx[100005], ans;
vector<int> gr[100005];
void dfs(int x, int p) {
  for (int i = 0; i < gr[x].size(); i++) {
    int u = gr[x][i];
    if (u == p) continue;
    dfs(u, x);
    if (mx[u]) mx[x] = max(mx[x], mx[u] + 1);
  }
}
void root(int x, int p) {
  if (mx[x] - 1 <= k) ans++;
  multiset<int> ms;
  if (mon[x]) ms.insert(0);
  for (int i = 0; i < gr[x].size(); i++) {
    int u = gr[x][i];
    if (mx[u] != 0) ms.insert(mx[u]);
  }
  for (int i = 0; i < gr[x].size(); i++) {
    int u = gr[x][i], ox = mx[x], ou = mx[u];
    if (u == p) continue;
    if (mx[u] != 0) ms.erase(ms.lower_bound(mx[u]));
    int sz = ms.size();
    if (ms.size() == 0)
      mx[x] = 0;
    else
      mx[x] = *--ms.end() + 1;
    for (int j = 0; j < gr[u].size(); j++) {
      int z = gr[u][j];
      if (mx[z]) mx[u] = max(mx[u], mx[z] + 1);
    }
    root(u, x);
    mx[x] = ox;
    mx[u] = ou;
    if (mx[u] != 0) ms.insert(mx[u]);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    mon[x]++;
    mx[x] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  dfs(1, 0);
  root(1, 0);
  cout << ans;
}
