#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
const int MININT = -100000000;
int n, m, d, max1[MAXN + 1], max2[MAXN + 1];
bool good[MAXN + 1], was[MAXN + 1];
vector<int> g[MAXN + 1];
int Up[MAXN + 1];
int DFS(int v, int pr) {
  max1[v] = MININT;
  max2[v] = MININT;
  if (good[v]) max1[v] = 0;
  was[v] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    if (!was[g[v][i]]) {
      int Max = DFS(g[v][i], v);
      if (max1[v] <= Max + 1) {
        max2[v] = max1[v];
        max1[v] = Max + 1;
      } else
        max2[v] = max(max2[v], Max + 1);
    }
  }
  return (max1[v]);
}
void DFS1(int v, int pr) {
  was[v] = 0;
  if (good[v])
    Up[v] = 0;
  else
    Up[v] = MININT;
  if (pr != -1) {
    Up[v] = max(Up[v], Up[pr] + 1);
    if (max1[pr] == max1[v] + 1)
      Up[v] = max(Up[v], max2[pr] + 1);
    else
      Up[v] = max(Up[v], max1[pr] + 1);
  }
  for (int i = 0; i < g[v].size(); i++) {
    if (was[g[v][i]]) {
      DFS1(g[v][i], v);
    }
  }
}
int main() {
  cin >> n >> m >> d;
  for (int i = 1; i <= n; i++) good[i] = 0, was[i] = 0;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    good[x] = 1;
  }
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  DFS(1, -1);
  DFS1(1, -1);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (d >= max(max1[i], Up[i])) ans++;
  }
  cout << ans;
  return 0;
}
