#include<bits/stdc++.h>
#define For(i,j,k) for(int i=(j);i<=(k);i++)
#define foR(i,j,k) for(int i=(j);i>=(k);i--)
#define vi vector<int>
#define pb push_back
#define pii pair<int,int>
#define mkp make_pair
#define SZ(x) ((int)x.size())
#define int long long
using namespace std;
inline int read() {
char c;int res=0;bool flag=0;
while(c=getchar(),c<48)(c=='-')&&(flag=1);
do res=(res<<3)+(res<<1)+(c^48);
while(c=getchar(),c>47);
flag&&(res=-res); return res;
}
const int MN=1e6+5;
int vis[MN],m,n,f[MN][2];
vi e[MN];
void dfs(int u,int fa) {
int mx=-n-1,sum=0,fl=0;
for(auto v:e[u]) {
if(v==fa) continue;
// cerr<<u<<' '<<v<<endl;
dfs(v,u);
mx=max(mx,f[v][1]-f[v][0]); sum+=f[v][0];
fl|=!vis[v];
}
cerr<<u<<' '<<fl<<endl;
if(vis[u]) {
f[u][1]=-n-1;
if(fl) f[u][0]=sum+mx+1;
else f[u][0]=0;
} else {
if(fl) f[u][1]=sum+mx+1;
else f[u][1]=0;
f[u][0]=sum+1;
}
}
void works() {
n=read(),m=read();
For(i,2,n) {
int u=read(),v=read();
e[u].pb(v),e[v].pb(u);
}
For(i,1,m) {
int x=read();
vis[x]=1;
}
dfs(1,0);
For(i,1,n) {
cerr<<f[i][0]<<' '<<f[i][1]<<endl;
}
cout<<f[1][0]<<endl;
}
signed main() {
#ifdef wasa855
freopen("pro.in","r",stdin);
freopen("pro.out","w",stdout);
#endif
int T=1;
while(T--) {
works();
}
return 0;
}