/*
TASK:trip
LANG:C++
*/

#include<iostream.h>
#include<stdio.h>
int a[105][105];
int used[1050];
int q[1050];
int vis[510];
int fucked[510];
int pred[1050];
int n,m,k;

void bfs(int vertex){
     q[0]=2;
     int temp=1;
     q[1]=vertex;
     pred[q[temp]]=-1;
     used[vertex]=1;
     while(q[temp]){
		    for(int i=1;i<=n;i++)
			    if(a[q[temp]][i] && !used[i]){
					     q[q[0]++]=i;
					     used[i]=1;
					     pred[i]=q[temp];
			    }
		    temp++;
     }
}

int count(){
    int br;
    int j;
    unsigned long cmax=0;
    for(int help=1;help<=n;help++){
		j=q[help];
		br=0;
		while(j!=-1){
				 if(!vis[j])br++;
				 j=pred[j];
		}

	    if(cmax<br)cmax=br;
    }
    return cmax;
}



int main(){
//    freopen("trip.in","r",stdin);
    cin>>n>>m>>k;
    int asd,p;
    for(int w=1;w<=m;w++){
	    cin>>p>>asd;
	    a[p][asd]=1;
	    a[asd][p]=1;
    }

    for(int r=1;r<=k;r++){
	    cin>>p;
	    vis[p]=1;
	    fucked[r]=p;
    }


    int vertex;
    unsigned long max=0;
    unsigned long fmax=0;
    for(int l=1;l<=k;l++){
	vertex=fucked[l];
	for(int po=0;po<=n;po++){
		used[po]=0;
		pred[po]=0;
	}

	bfs(vertex);
    //	cout<<"Queue...\n";
//	for(int i=1;i<=n;i++)
  //		    cout<<q[i]<<" ";
      //	cout<<endl;
      //	cout<<"Count...\n";
	fmax=count();
	if(fmax>max)max=fmax;

    }
    cout<<max<<endl;
   // cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
    return 0;
}
