#include <bits/stdc++.h>
using namespace std;
long long get() {
  char c = getchar();
  long long x = 0LL;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    x *= 10LL;
    x += (c - '0');
    c = getchar();
  }
  return x;
}
string i_t_s(int x) {
  string t = "";
  while (x) {
    t += x % 10 + '0';
    x /= 10;
  }
  reverse(t.begin(), t.end());
  return t;
}
int s_t_i(string t) {
  int x = 0;
  for (int i = 0; i < (int)(t.size()); i++) {
    x = x * 10 + (t[i] - '0');
  }
  return x;
}
long long q_p(long long x, long long y) {
  long long res = 1;
  x %= 1000000007;
  while (y) {
    if (y % 2) {
      res = res * x;
      res %= 1000000007;
    }
    y /= 2;
    x = x * x;
    x %= 1000000007;
  }
  return res;
}
bool ok(int x, int y, int n, int m) {
  return (x >= 0 && x < n && y >= 0 && y < m);
}
bool isprime(int x) {
  if (x < 2) return false;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int dx[4] = {0, -1, 0, 1}, dy[4] = {1, 0, -1, 0};
int n, m, d;
int dp1[100001], dp2[100001];
vector<int> v[100001];
bool f[100001];
int m1[100001], m2[100001];
void dfs(int x, int fx) {
  if (dp1[x] < 0 && f[x]) dp1[x] = 0;
  int mx1 = -1, mx2 = -1;
  for (int i = 0; i < (int)(v[x].size()); i++) {
    if (v[x][i] == fx) continue;
    dfs(v[x][i], x);
    if (mx1 == -1)
      mx1 = v[x][i];
    else {
      if (dp1[v[x][i]] + 1 > dp1[mx1] + 1)
        mx2 = mx1, mx1 = v[x][i];
      else {
        if (mx2 == -1)
          mx2 = v[x][i];
        else if (dp1[mx2] + 1 < dp1[v[x][i]] + 1)
          mx2 = v[x][i];
      }
    }
    dp1[x] = max(dp1[x], dp1[v[x][i]] + 1);
  }
  m1[x] = mx1;
  m2[x] = mx2;
}
void dfs2(int x, int fx) {
  for (int i = 0; i < (int)(v[x].size()); i++) {
    if (v[x][i] == fx) continue;
    dp2[v[x][i]] = dp2[x] + 1;
    if (dp2[x] < 0 && f[x]) dp2[v[x][i]] = 1;
    if (m1[x] != -1 && m1[x] == v[x][i]) {
      if (m2[x] != -1) dp2[v[x][i]] = max(dp2[v[x][i]], dp1[m2[x]] + 2);
    } else if (m1[x] != -1)
      dp2[v[x][i]] = max(dp2[v[x][i]], dp1[m1[x]] + 2);
    dfs2(v[x][i], x);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> d;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    x--;
    f[x] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--, y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 0; i < n; i++) dp1[i] = dp2[i] = -1e9;
  dfs(0, -1);
  dfs2(0, -1);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (max(dp1[i], dp2[i]) <= d) ans++;
  }
  cout << ans;
  return 0;
}
