#include<iostream>
#include<functional>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>Q;
int n, m, k, a[100000], b[100000], c[100000], r[10000], dist[10000];
vector<pair<int, int>>x[10000];
void dijkstra() {
	for (int i = 1; i <= n; i++) dist[i] = 999999999;
	for (int i = 0; i < k; i++) { dist[r[i]] = 0; Q.push(make_pair(0, r[i])); }
	while (!Q.empty()) {
		int a1 = Q.top().first, a2 = Q.top().second; Q.pop();
		for (int i = 0; i < x[a2].size(); i++) {
			if (dist[x[a2][i].first] > a1 + x[a2][i].second) {
				dist[x[a2][i].first] = a1 + x[a2][i].second;
				Q.push(make_pair(dist[x[a2][i].first], x[a2][i].first));
			}
		}
	}
}
int main() {
	cin >> n >> m >> k;
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i] >> c[i]; 
		x[a[i]].push_back(make_pair(b[i], c[i]));
		x[b[i]].push_back(make_pair(a[i], c[i]));
	}
	for (int i = 0; i < k; i++)cin >> r[i];
	dijkstra();
	int maxn = 0;
	for (int i = 0; i < m; i++) {
		int R1 = min(dist[a[i]], dist[b[i]]);
		int R2 = (c[i] + abs(dist[a[i]] - dist[b[i]]) + 1) / 2;
		maxn = max(maxn, R1 + R2);
	}
	cout << maxn << endl;
	return 0;
}