#include <iostream>
#include <queue>
#include <map>
#include <cmath>
#define INF 1e+9
using namespace std;

typedef pair<int,int> P;
struct edge{ int to,cost; };

int main(){
	int n,m,k,a,b,l,s;
	int d[3000];
	vector<edge> G[3000];
	queue<P> que; 
	cin >> n >> m >> k;
	for(int i = 0;i < n;i++) {
		d[i] = INF;
	}
	for(int i = 0;i < m;i++){
		cin >> a >> b >> l;
		G[a - 1].push_back({b - 1,l});
		G[b - 1].push_back({a - 1,l});
	}
	for(int i = 0;i < k;i++){
		cin >> s;
		que.push(P(s - 1,0));
	}
	while(!que.empty()){
		P p = que.front();que.pop();
		if(d[p.first] <= p.second) continue;
		d[p.first] = p.second;
		for(int i = 0;i < G[p.first].size();i++){
			if(d[p.first] + G[p.first][i].cost < d[G[p.first][i].to]) que.push({G[p.first][i].to,d[p.first] + G[p.first][i].cost});
		}
	}
	double ma = 0;
	for(int i = 0;i < n;i++){
		for(int j = 0;j < G[i].size();j++){
			ma = max(ma,(double)(d[i] + d[G[i][j].to] + G[i][j].cost) / 2.0);
		}
	}
	cout << (int)round(ma) << endl;
	return 0;
}