#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const int INF=1e9;
struct dat{int a,b,c;};
struct edge{int to,cost;};
int d[3030],n,m,k;
vector<edge>G[3030];
void dijkstra(int s){
	d[s]=0;
	priority_queue<P,vector<P>,greater<P> >Q;
	Q.push(MP(0,s));
	while(!Q.empty()){
		P p=Q.top();Q.pop();
		int v=p.second;
		if(d[v]<p.first)continue;
		REP(i,G[v].size()){
			int to=G[v][i].to,cost=G[v][i].cost;
			if(d[to]>d[v]+cost){
				d[to]=d[v]+cost;
				Q.push(MP(d[to],to));
			}
		}
	}
}
int main(){
	REP(i,3030)d[i]=INF;
	cin>>n>>m>>k;
	vector<dat>road;
	REP(i,m){
		int a,b,c;
		cin>>a>>b>>c;a--;b--;
		road.PB((dat){a,b,c});
		G[a].PB((edge){b,c});
		G[b].PB((edge){a,c});
	}
	REP(i,k){
		int s;
		cin>>s;s--;
		dijkstra(s);
	}
	int ans=0;
	REP(i,road.size()){
		dat v=road[i];
		ans=max(ans,(d[v.a]+d[v.b]+v.c+1)/2);
	}
	cout<<ans<<endl;
}