/*
LANG: C
TASK: trip
*/

#include <stdio.h>
#include <string.h>
#define MAX 1024
FILE *in; FILE *out;
int n, m, k;
//int ma3x[MAX][MAX];
int vis[MAX];
int op[MAX][2]; int len;
int go[MAX][MAX];
int np[MAX];

void init(void)
{
int i, c;

for (i=0; i<MAX; i++) {np[i] = 0; vis[i] = 0; op[i][0] = 0; op[i][1] = 0;}
//for (i=0; i<MAX; i++) for (c=0; c<MAX; c++) {go[i][c] = 0; ma3x[i][c] = -1;}
for (i=0; i<MAX; i++) for (c=0; c<MAX; c++) {go[i][c] = 0;}
for (i=0; i<MAX; i++) go[i][0] = 1;

return;
}


void input(void)
{
int i, x, y;
//in = fopen("trip.in", "rt"); out = fopen("trip.out", "wt");
in = stdin; out = stdout;

fscanf(in, "%d %d %d", &n, &m, &k);
for (i=0; i<m; i++)
    {
    fscanf(in, "%d %d", &x, &y);
//    ma3x[x][y]=1;
    go[x][go[x][0]] = y; go[x][0]++;
    go[y][go[y][0]] = x; go[y][0]++;
    }
for (i=0; i<k; i++) {fscanf(in, "%d", &x); np[x] = 1;}

fclose(in);

return;
}

void output(int ans)
{

fprintf(out, "%d\n", ans);
fclose(out);

return;
}


int gg(int city)
{
int i, c;
int cur;
int cnt = 0;

for (i=0; i<=n; i++) vis[i] = 0;

len = 1; i = 0;
op[0][0] = city; op[0][1] = 1; vis[city] = 1;

while (i<len)
      {
      cur = op[i][0];
      for (c=1; c<go[cur][0]; c++)
	  {
	  if (vis[go[cur][c]] == 0)
	     {
	     vis[go[cur][c]] = 1;
	     op[len][0] = go[cur][c];
	     if (np[go[cur][c]]) op[len][1] = op[i][1];
	     else op[len][1] = op[i][1] + 1;
	     len++;
	     }
	  }
      i++;
      }

for (i=0; i<len; i++) if (op[i][1] > cnt) cnt = op[i][1];
//for (i=0; i<len; i++) fprintf(out, "%d %d\n", op[i][0], op[i][1]); fprintf(out, "\n");

return cnt;
}


int dowork(void)
{
int i, c;
int ans = 0;
int tmp;

for (i=1; i<=n; i++) if (!np[i])
	{
	tmp = gg(i);
	if (tmp>ans)
	   {
	   ans = tmp;
//	   fprintf(out, "New record %d set starting from city %d!\n", ans, i);
	   }
	}

return ans;
}


int main(void)
{
int ans;

init();
input();
ans = dowork();
output(ans);

return 0;
}
