#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<int> E[100005];
bool aff[100005];
bool vis[100005];
int d1[100005], d2[100005];
int deep, st, ed;
void DFS1(int x, int d) {
  if (aff[x] && deep < d) {
    deep = d;
    st = x;
  }
  vis[x] = 1;
  for (__typeof(E[x].begin()) it = E[x].begin(); it != E[x].end(); it++) {
    if (!vis[*it]) {
      DFS1(*it, d + 1);
    }
  }
}
void DFS2(int x, int d) {
  if (aff[x] && deep < d) {
    deep = d;
    ed = x;
  }
  vis[x] = 1;
  d1[x] = d;
  for (__typeof(E[x].begin()) it = E[x].begin(); it != E[x].end(); it++) {
    if (!vis[*it]) {
      DFS2(*it, d + 1);
    }
  }
}
void DFS3(int x, int d) {
  vis[x] = 1;
  d2[x] = d;
  for (__typeof(E[x].begin()) it = E[x].begin(); it != E[x].end(); it++) {
    if (!vis[*it]) {
      DFS3(*it, d + 1);
    }
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> d;
  for (int i = 1; i <= m; ++i) {
    int a;
    cin >> a;
    aff[a] = 1;
  }
  for (int i = 1; i <= n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  deep = -1;
  DFS1(1, 0);
  deep = -1;
  memset(vis, 0, sizeof(vis));
  DFS2(st, 0);
  deep = -1;
  memset(vis, 0, sizeof(vis));
  DFS3(ed, 0);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (d1[i] <= d && d2[i] <= d) {
      ++ans;
    }
  }
  cout << ans << '\n';
  return 0;
}
