#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50, M = N << 1;
int adj[N], nxt[M], to[M], ecnt;
int p[N], dis[N];
bool bp[N];
inline void addEdge(int f, int t)
{
    ecnt++;
    nxt[ecnt] = adj[f];
    adj[f] = ecnt;
    to[ecnt] = t;
}
int main()
{
    int n, k;
    scanf("%d%d", &n, &k);
    for (int i = 1, u, v; i < n; i++)
        scanf("%d%d", &u, &v), addEdge(u, v), addEdge(v, u);
    for (int i = 0; i < k; i++)
        scanf("%d", p + i), bp[p[i]] = true;
    if (p == 0) return puts("0"), 0;
    int h = 0, t = 0;
    static int que[N];
    memset(dis, 0x3f, sizeof(dis));
    for (dis[que[t++] = *p] = 0; h ^ t; h++)
        for (int x, e = adj[x = que[h]]; e; e = nxt[e])
            if (dis[to[e]] > dis[x] + 1)
                dis[que[t++] = to[e]] = dis[x] + 1;
    int mxid = -1, mxval = 0;
    for (int i = 0; i < k; i++)
        if (mxval < dis[p[i]]) mxval = dis[mxid = p[i]];
    h = t = 0;
    memset(dis, 0x3f, sizeof(dis));
    for (dis[que[t++] = mxid] = 0; h ^ t; h++)
        for (int x, e = adj[x = que[h]]; e; e = nxt[e])
            if (dis[to[e]] > dis[x] + 1)
                dis[que[t++] = to[e]] = dis[x] + 1;
    mxid = -1, mxval = 0;
    for (int i = 0; i < k; i++)
        if (mxval < dis[p[i]]) mxval = dis[mxid = p[i]];
    printf("%d", (mxval + 1) >> 1);
    return 0;
}