#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, d, f[N], g[N];
vector<int> e[N];
bool mrk[N];
void dfsf(int x, int p) {
  f[x] = mrk[x] ? 0 : -1;
  for (int i = 0; i < e[x].size(); ++i) {
    int y = e[x][i];
    if (y == p) continue;
    dfsf(y, x);
    if (f[y] != -1) {
      f[x] = max(f[x], f[y] + 1);
    }
  }
}
void dfsg(int x, int p) {
  int maxy = -1, maxf = -1;
  for (int i = 0; i < e[x].size(); ++i) {
    int y = e[x][i];
    if (y == p) continue;
    if (f[y] != -1 && f[y] + 1 == f[x]) {
      maxy = y;
      break;
    }
  }
  for (int i = 0; i < e[x].size(); ++i) {
    int y = e[x][i];
    if (y == p) continue;
    if (y != maxy && f[y] != -1) {
      maxf = max(maxf, f[y] + 1);
    }
  }
  for (int i = 0; i < e[x].size(); ++i) {
    int y = e[x][i];
    if (y == p) continue;
    if (f[x] >= 0) {
      if (y == maxy) {
        g[y] = maxf < 0 ? -1 : maxf + 1;
      } else {
        g[y] = f[x] < 0 ? -1 : f[x] + 1;
      }
    }
    g[y] = max(g[y], g[x] < 0 ? -1 : g[x] + 1);
    dfsg(y, x);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &d);
  for (int p, i = 0; i < m; ++i) {
    scanf("%d", &p);
    mrk[p] = true;
  }
  for (int a, b, i = 1; i < n; ++i) {
    scanf("%d%d", &a, &b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfsf(1, 0);
  g[1] = mrk[1] ? 0 : -1;
  dfsg(1, 0);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (f[i] <= d && g[i] <= d) {
      ++ans;
    }
  }
  printf("%d\n", ans);
}
