import core.stdc.stdio;
import std.container;
import std.algorithm;
import std.typecons;
import std.stdio;

void main(){
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	alias Tuple!(int,"cost",int,"to") ct;
	ct[][] graph = new ct[][n];
	alias Tuple!(int,"a",int,"b",int,"l") edge;
	edge[] es = new edge[m];
	foreach(ref e;es){
		scanf("%d%d%d",&e.a,&e.b,&e.l);
		graph[--e.a]~=ct(e.l,--e.b);
		graph[e.b]~=ct(e.l,e.a);
	}
	auto pq = BinaryHeap!(ct[],"a>b")(new ct[n+m],0);
	int[] nc = new int[n];
	nc[] = 1145141919;
	foreach(i;0..k){
		int a;
		scanf("%d",&a);
		nc[--a]=0;
		pq.insert(ct(0,a));
	}
	while(!pq.empty){
		auto t=pq.front;
		pq.popFront;
		with(t){
			if(cost>nc[to])
				continue;
			foreach(c;graph[to]){
				if(nc[c.to]>cost+c.cost){
					nc[c.to]=cost+c.cost;
					pq.insert(ct(cost+c.cost,c.to));
				}
			}
		}
	}
	int ans;
	foreach(e;es)
		ans = max(ans,e.l+nc[e.a]+nc[e.b]);
	printf("%d\n",(ans+1)/2);
}