#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<int, int>P;

vector<P>E[3000];
int d[3000];
int main() {
	int n, m, k; scanf("%d%d%d", &n, &m, &k);
	rep(i, m) {
		int a, b, l; scanf("%d%d%d", &a, &b, &l);
		a--; b--;
		E[a].push_back(P(l, b));
		E[b].push_back(P(l, a));
	}
	priority_queue<P, vector<P>, greater<P>>que;
	memset(d, 0x3f, sizeof(d));
	rep(i, k) {
		int s; scanf("%d", &s); s--;
		d[s] = 0;
		que.push(P(0, s));
	}
	while (!que.empty()) {
		P p = que.top(); que.pop();
		if (d[p.second] != p.first)continue;
		for (P u : E[p.second]) {
			if (d[u.second] > p.first + u.first) {
				d[u.second] = p.first + u.first;
				que.push(P(d[u.second], u.second));
			}
		}
	}
	double Max = 0;
	rep(i, n) {
		for (P u : E[i]) {
			double t = (u.first + abs(d[i] - d[u.second])) / 2.;
			Max = max(Max, min(d[i], d[u.second]) + t);
		}
	}
	printf("%d\n", (int)round(Max));
}