#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:512000000")
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline string tostr(const T &x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
const double EPS = 1e-6;
const int INF = 1000 * 1000 * 1000;
const char CINF = 102;
const long long LINF = INF * 1ll * INF;
const long double PI = 3.1415926535897932384626433832795;
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
unsigned int gcd(unsigned int a, unsigned int b) {
  return a ? gcd(b % a, a) : b;
}
int n;
vector<int> gr[110000];
int D[110000];
bool A[110000];
int res;
int L;
int dfs1(int v, int pr) {
  int r = -1;
  if (A[v]) r = 0;
  for (int i = 0; i < (((int)(gr[v]).size())); ++i) {
    int p = gr[v][i];
    if (p == pr) continue;
    int t = dfs1(p, v);
    if (t != -1) r = max(r, t + 1);
  }
  D[v] = r;
  return r;
}
void dfs2(int v, int pr, int d) {
  if (d <= L && D[v] <= L) {
    ++res;
  }
  if (A[v] && d == -1) d = 0;
  int mx1 = -1, mx2 = -1;
  for (int i = 0; i < (((int)(gr[v]).size())); ++i) {
    int p = gr[v][i];
    if (p == pr) continue;
    int t = D[p];
    if (t == -1) continue;
    ++t;
    if (t > mx1) {
      mx2 = mx1;
      mx1 = t;
    } else if (t > mx2) {
      mx2 = t;
    }
  }
  for (int i = 0; i < (((int)(gr[v]).size())); ++i) {
    int p = gr[v][i];
    if (p == pr) continue;
    int t = D[p];
    int x = mx1;
    if (t != -1 && t + 1 == mx1) {
      x = mx2;
    }
    if (x != -1) ++x;
    if (d != -1) x = max(x, d + 1);
    dfs2(p, v, x);
  }
}
int main(int argc, char **argv) {
  int m;
  cin >> n >> m >> L;
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    --a;
    A[a] = true;
  }
  for (int i = 0; i < (n - 1); ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  dfs1(0, -1);
  dfs2(0, -1, -1);
  cout << res;
  return 0;
}
