#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <cstring>
 
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define MP make_pair
#define X first
#define Y second
#define all(v) v.begin(), v.end()
 
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> P;

const int INF = 1<<29;

int dist[3001];
bool visit[3001];
pair<P, int> edge[100001];

vector<P> G[3001];

int main(){
	int n, m, k;
	cin >> n >> m >> k;
	rep(i, m){
		int a, b, l;
		cin >> a >> b >> l;
		a--, b--;
		G[a].push_back(MP(l, b));
		G[b].push_back(MP(l, a));
		edge[i] = MP(MP(a, b), l);
	}

	priority_queue<P, vector<P>, greater<P> > q;

	rep(i, k){
		int s;
		cin >> s;
		q.push(MP(0, s-1));
	}

	while(!q.empty()){
		int pos = q.top().Y;
		int d = q.top().X;
		q.pop();

		if(visit[pos])continue;
		visit[pos] = true;

		dist[pos] = d;

		rep(i, G[pos].size()){
			q.push(MP(d+G[pos][i].first, G[pos][i].second));
		}
	}

	double ans = 0;
	rep(i, m){
		double l, s, d;
		l = dist[edge[i].first.first];
		s = dist[edge[i].first.second];
		d = edge[i].second;
		if(l < s) swap(l, s);
		if(l > s+d){
			ans = max(ans, l);
		}else{
			ans = max(ans, (s+l+d)/2);
		}
	}

	cout << (int)(ans+0.5) << endl;


    return 0;
}