#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<random>
#include<functional>

#define rep(i,n) for(int i=0; i<n; i++)
#define pb push_back
#define pint pair<int, int>
#define mp make_pair

using namespace std;

typedef long long ll;


const int INF = 1e9;

struct edge
{
	int to, co;
	edge(int t, int c) : to(t), co(c) {}
};

int N, M, K;
int main() {
	iostream::sync_with_stdio(false);

	cin >> N >> M >> K;

	vector< vector<edge> > g(N);

	for (int i = 0; i < M; i++) {
		int a, b, l;
		cin >> a >> b >> l;
		a--; b--;

		g[a].push_back(edge(b, l));
		g[b].push_back(edge(a, l));
	}

	priority_queue<pint, vector<pint>, greater<pint>> pq;
	vector<int> cost(N, INF);
	vector<bool> used(N, false);

	for (int i = 0; i < K; i++) {
		int s;
		cin >> s;
		s--;
		pq.push(mp(0, s));
		cost[s] = 0;
	}

	while (!pq.empty())
	{
		int c = pq.top().first;
		int v = pq.top().second;
		pq.pop();

		if (used[v]) continue;
		used[v] = true;

		for (auto e : g[v]) {
			if (cost[e.to] > cost[v] + e.co) {
				cost[e.to] = cost[v] + e.co;
				pq.push(mp(cost[e.to], e.to) );
			}
		}
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		for (auto e : g[i]) {
			int l = abs(cost[i] - cost[e.to]);
			if (e.co == l) ans = max({ans, cost[i], cost[e.to]});
			else {
				ans = max(ans, (cost[i] + cost[e.to] + e.co + 1) / 2);
			}
		}
	}

	cout << ans << endl;


	return 0;
}


