#include <bits/stdc++.h>
using namespace std;
bool pm1[100100], pm2[100100], ist[100100];
int bvn[100100], bvv[100100];
vector<int> rb[100100];
void dfs2(int u, int bv) {
  if (ist[u]) {
    bv = max(0, bv);
  }
  int i, c1 = bv, c2 = -10000000;
  bvv[u] = bv;
  pm2[u] = 1;
  for (i = 0; i < rb[u].size(); i++)
    if (!pm2[rb[u][i]])
      if (bvn[rb[u][i]] + 1 > c1) {
        c2 = c1;
        c1 = bvn[rb[u][i]] + 1;
      } else if (bvn[rb[u][i]] + 1 > c2) {
        c2 = bvn[rb[u][i]] + 1;
      }
  for (i = 0; i < rb[u].size(); i++)
    if (!pm2[rb[u][i]])
      if (bvn[rb[u][i]] + 1 != c1) {
        dfs2(rb[u][i], c1 + 1);
      } else {
        dfs2(rb[u][i], c2 + 1);
      }
}
int dfs1(int u) {
  int i, o = -10000000;
  pm1[u] = 1;
  if (ist[u]) {
    o = 0;
  }
  for (i = 0; i < rb[u].size(); i++)
    if (!pm1[rb[u][i]]) {
      o = max(o, dfs1(rb[u][i]) + 1);
    }
  bvn[u] = o;
  return (o);
}
int main() {
  int n, m, k, i;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < m; i++) {
    int u;
    scanf("%d", &u);
    ist[u] = 1;
  }
  for (i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    rb[u].push_back(v);
    rb[v].push_back(u);
  }
  dfs1(1);
  dfs2(1, -10000000);
  int o = 0;
  for (i = 1; i <= n; i++) {
    if (max(bvn[i], bvv[i]) <= k) {
      o++;
    }
  }
  printf("%d", o);
}
