{
TASK:trip
LANG:PASCAL
}
{$S-}
const inf=9000;
var a,b:Array[1..1001,1..1001]of Integer;
    d:Array[1..1001,1..1001]of boolean;
    father:Array[1..1001] of Integer;
    pass,vis:Array[1..1001]of boolean;
    i,j,n,k,m,x,y,br,maxbr:Longint;
Procedure cleartheway;
var i:Integer;
Begin
 For i:=1 to n do father[i]:=0;
 For i:=1 to n do vis[i]:=false;
End;
Procedure digandcount(x:Integer);
Begin
 if not pass[x] then br:=br+1;
 if father[x]<>0 then digandcount(father[x]);
End;
Procedure Dejkstra(x,y:Integer);
var i,j,min,mincity:Integer;
Begin
  cleartheway;
 Repeat
   min:=inf;
   mincity:=0;
  For i:=1 to n do
   if (a[x,i]<min)and(not vis[i]) then
    Begin
      min:=a[x,i];
      mincity:=i;
    End;
  if (mincity<>0)and(min<>inf)then
  Begin
    vis[mincity]:=true;
   for i:=1 to n do
    if i<>x then
    if a[x,i]>a[x,mincity]+a[mincity,i] then
     Begin
       a[x,i]:=a[x,mincity]+a[mincity,i];
       a[i,x]:=a[x,mincity]+a[mincity,i];
       father[i]:=mincity;
     End;
  End;
 Until mincity=0;
 if a[x,y]<inf then
 Begin
   br:=0;
   digandcount(y);
   if maxbr<br then maxbr:=br;
 End;
End;
Begin
  ReadLn(n,m,k);
 For i:=1 to n do
  For j:=1 to n do
   a[i,j]:=inf;
 For i:=1 to m do
 Begin
   ReadLn(x,y);
   a[x,y]:=1;
   a[y,x]:=1;
 End;
   b:=a;
 For i:=1 to k do
 Begin
   Read(x);
   pass[x]:=true;
 End;
 For i:=1 to n do
  For j:=1 to n do
   if (i<>j) then
   if (not d[i,j]) then
    Begin
      d[i,j]:=true;
      d[j,i]:=true;
      a:=b;
      dejkstra(i,j);
    End;
  WriteLn(maxbr);
End.
