#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<bool> isMarked;
vector<vector<int> > tree;
vector<int> distDown, distUp;
const int MINUS_INF = numeric_limits<int>::min();
void enterData() {
  cin >> n >> m >> d;
  isMarked.resize(n);
  for (int i = 0; i < m; ++i) {
    int v;
    cin >> v;
    isMarked[v - 1] = true;
  }
  tree.resize(n);
  for (int i = 0; i < n - 1; ++i) {
    int beg, end;
    cin >> beg >> end;
    tree[beg - 1].push_back(end - 1);
    tree[end - 1].push_back(beg - 1);
  }
  distDown.resize(n);
  distUp.resize(n);
}
int DFS_1(int v, int p) {
  distDown[v] = isMarked[v] ? 0 : -1;
  for (int i = 0; i < tree[v].size(); ++i) {
    int u = tree[v][i];
    if (u == p) continue;
    int d = DFS_1(u, v);
    if (d > -1) distDown[v] = max(distDown[v], d + 1);
  }
  return distDown[v];
}
void DFS_2(int v, int p) {
  int max1 = -1, max2 = -1;
  for (int i = 0; i < tree[v].size(); ++i) {
    int u = tree[v][i];
    if (u == p) continue;
    if (distDown[u] > max1) {
      max2 = max1;
      max1 = distDown[u];
    } else if (distDown[u] > max2) {
      max2 = distDown[u];
    }
  }
  for (int i = 0; i < tree[v].size(); ++i) {
    int u = tree[v][i];
    if (u == p) continue;
    int siblingDistance = (distDown[u] == max1) ? max2 : max1;
    if (siblingDistance != -1) siblingDistance += 2;
    distUp[u] = siblingDistance;
    if (distUp[v] != -1) distUp[u] = max(distUp[u], distUp[v] + 1);
    if (isMarked[u]) distUp[u] = max(distUp[u], 0);
    DFS_2(u, v);
  }
}
int main() {
  enterData();
  DFS_1(0, -1);
  distUp[0] = isMarked[0] ? 0 : -1;
  DFS_2(0, -1);
  int count = 0;
  for (int i = 0; i < n; ++i) {
    if (distDown[i] <= d && distUp[i] <= d) ++count;
  }
  cout << count << endl;
  return 0;
}
