N = int(input()) G = [[] for _ in range(N)] for _ in range(N - 1): a,b = map(int,input().split()) a -= 1 b -= 1 G[a].append(b) G[b].append(a) M = int(input()) V = list(map(int,input().split())) s = set() for v in V: s.add(v - 1) l = [0] * N ll = [0] * N for v in V: v -= 1 for u in G[v]: l[u] += 1 ll[u] = 1 ll[v] = 1 S = sum(ll) d = [0] * N for v in V: v -= 1 for u in G[v]: if l[u] == 1 and u not in s: d[v] += 1 for i in range(N): tmp = 0 count = 0 for u in G[i]: if u in s: tmp += d[u] if i in s: tmp += d[i] tmp += 1 for v in G[i]: if v in s:tmp += 1 else: for v in G[i]: if v in s: if l[v] == 0:tmp += 1 else: if l[v] == 0:tmp += 1 if l[i] >= 2:tmp += 1 print(S - tmp)