#include <iostream>
#include <queue>
#include <set>
#include <vector>

using namespace std;

vector<set<int>> g;
vector<int> callstack;
queue<int> q;

void search(int u) {
  callstack[u] = 1;
  for (int v : g[u]) search(v);
  while (callstack[q.front()]) q.pop();
  callstack[u] = 0;
}

int solve() {
  int n, m;
  cin >> n >> m;

  g = vector<set<int>>(n+1);
  q = queue<int>();
  callstack.assign(n+1, 0);

  for (int i = 1, a, b; i < n; ++i) {
    cin >> a >> b;
    g[a].insert(b);
  }

  for (int i = 0, d; i < m; ++i) {
    cin >> d;
    q.push(d);
  }
  q.push(0);

  search(1);

  return m+1-q.size();
}

int main() {
  cout << solve() << endl;
}
