{
TASK:trip
LANG:PASCAL
}

var
  a,b: array[1..10,1..10] of Longint;
  vis: array[1..10] of Boolean;
  n,m,k,i,j,p: Integer;
  max: Integer;

begin
  readln(n,m,k);
  for i:= 1 to n do
    for j:= 1 to n do
    begin
      a[i,j]:= maxlongint;
      b[i,j]:= 0;
    end;
  for i:= 1 to n do
    vis[i]:= false;
  for p:= 1 to m do
  begin
    readln(i,j);
    a[i,j]:= 1;
    a[j,i]:= 1;
  end;
  for i:= 1 to k do
  begin
    read(p);
    vis[p]:= true;
  end;

  for p:= 1 to n do
    for i:= 1 to n-1 do
      for j:= i+1 to n do
        if (a[i,p]<>maxlongint) and (a[p,j]<>maxlongint) then
          if a[i,p]+a[p,j]<a[i,j] then
          begin
            a[i,j]:= a[i,p]+a[p,j];
            a[j,i]:= a[j,p]+a[p,i];
            if not vis[p] then
            begin
              b[i,j]:= b[i,p]+b[p,j]+1;
              b[j,i]:= b[j,p]+b[p,i]+1;
            end;
          end;

  for i:= 1 to n-1 do
    for j:= i+1 to n do
    begin
      if not vis[i] then
      begin
        inc(b[i,j]);
        inc(b[j,i]);
      end;
      if not vis[j] then
      begin
        inc(b[i,j]);
        inc(b[j,i]);
      end;
    end;


  max:= 0;
  for i:= 1 to n do
    for j:= 1 to n do
    begin
      if b[i,j]>max then
        max:= b[i,j];
    end;

  writeln(max);

end.