n=int(input()) e=[[] for i in range(n)] for i in range(n-1): a,b=map(int,input().split()) a-=1 b-=1 e[a]+=[b] e[b]+=[a] m=int(input()) x=[0]*n y=[0]*n for s in list(map(int,input().split())): x[s-1]+=1 for t in e[s-1]: x[t]+=1 y[s-1]=1 X=0 v=[0]*n u=[0]*n p=[0]*n g=[0]*n q=[0] while len(q)>0: s=q[-1] if v[s]==0: v[s]=1 X+=x[s]>=1 while g[s]0 print(X-a)