{
TASK:trip
LANG:PASCAL
}
{$R-}
const
 max=1001;
var
  b:array [0..max,0..max] of integer;
  bc,mn:array [0..max] of integer;
  u,c:array [0..max] of boolean;
  q1,q2:array [0..max*max] of integer;
  i,j,k,l,n,m,bm,mx:longint;
  t:text;

  procedure dfs(r:integer);
   var
    i,j:integer;
   begin
     inc(mn[bm]);
     u[r]:=true;
     for i:=1 to bc[r] do
      if not u[b[r,i]] then
       dfs(b[r,i]);
   end;

begin
{  assign(t,'trip.in1');
  reset (t);}
  readln ({t,}n,m,k);
  for i:=1 to m do readln({t,}q1[i],q2[i]);
  for i:=1 to k do begin read({t,}l); c[l]:=true; end;
  for i:=1 to m do
   if (not c[q1[i]])and(not c[q2[i]]) then
    begin
      inc(bc[q1[i]]);
      inc(bc[q2[i]]);
      b[q1[i],bc[q1[i]]]:=q2[i];
      b[q2[i],bc[q2[i]]]:=q1[i];
    end;
{  close(t);}

  for i:=1 to n do
   if (not c[i])and(not u[i]) then
    begin
      inc(bm);
      dfs(i);
      if mn[bm]>mx then mx:=mn[bm];
    end;

  writeln(mx);
end.
