#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	Info(int arg_to,int arg_dist){
		to = arg_to;
		dist = arg_dist;
	}
	int to,dist;
};

struct Data{
	Data(){
		town = dist = 0;
	}
	Data(int arg_town,int arg_dist){
		town = arg_town;
		dist = arg_dist;
	}
	bool operator<(const struct Data &arg) const{
			return dist > arg.dist;
	};
	int town,dist;
};

int main(){

	int N,M,K;
	scanf("%d %d %d",&N,&M,&K);

	int** road = new int*[N+1];
	for(int i = 1; i <= N; i++){
		road[i] = new int[N+1];
		for(int k = 1; k <= N; k++)road[i][k] = BIG_NUM;
	}

	int min_dist_to_market[N+1];
	for(int i = 1; i <= N; i++)min_dist_to_market[i] = BIG_NUM;

	vector<Info> V[N+1];

	int from,to,dist;
	for(int i = 0; i < M; i++){
		scanf("%d %d %d",&from,&to,&dist);
		V[from].push_back(Info(to,dist));
		V[to].push_back(Info(from,dist));
		road[from][to] = dist;
		road[to][from] = dist;
	}

	bool is_mall[N+1];
	for(int i = 1; i <= N; i++)is_mall[i] = false;

	int tmp;

	for(int i = 0; i < K; i++){
		scanf("%d",&tmp);
		is_mall[tmp] = true;
		min_dist_to_market[tmp] = 0;
	}

	int ans = -1,min_index;

	priority_queue<Data> Q;

	int tmp_min_dist[N+1];

	if(N-K <= K){

		for(int start = 1; start <= N; start++){
			if(!is_mall[start]){

				for(int i = 1; i <= N; i++)tmp_min_dist[i] = BIG_NUM;

				tmp_min_dist[start] = 0;

				for(int i = 0; i < V[start].size();i++){
					tmp_min_dist[V[start][i].to] = V[start][i].dist;
					Q.push(Data(V[start][i].to,V[start][i].dist));
				}


				while(!Q.empty()){
					if(Q.top().dist > tmp_min_dist[Q.top().town]){
						Q.pop();
					}else{
						min_index = Q.top().town;
						Q.pop();

						for(int k = 0; k < V[min_index].size(); k++){
							if(tmp_min_dist[V[min_index][k].to] > tmp_min_dist[min_index]+V[min_index][k].dist){
								tmp_min_dist[V[min_index][k].to] = tmp_min_dist[min_index]+V[min_index][k].dist;
								Q.push(Data(V[min_index][k].to,tmp_min_dist[V[min_index][k].to]));
							}
						}
					}
				}

				int tmp_min = BIG_NUM;

				for(int i = 1; i <= N; i++){
					if(is_mall[i] == true){
						tmp_min = min(tmp_min,tmp_min_dist[i]);
					}
				}
				min_dist_to_market[start] = tmp_min;
			}
		}

		for(int i = 1; i <= N; i++){
			ans = max(ans,min_dist_to_market[i]);
		}

	}else{

		for(int start = 1; start <= N; start++){
			if(is_mall[start]){

				for(int i = 1; i <= N; i++)tmp_min_dist[i] = BIG_NUM;

				tmp_min_dist[start] = 0;

				for(int i = 0; i < V[start].size();i++){
					tmp_min_dist[V[start][i].to] = V[start][i].dist;
					Q.push(Data(V[start][i].to,V[start][i].dist));
				}


				while(!Q.empty()){
					if(Q.top().dist > tmp_min_dist[Q.top().town]){
						Q.pop();
					}else{
						min_index = Q.top().town;
						Q.pop();

						for(int k = 0; k < V[min_index].size(); k++){
							if(tmp_min_dist[V[min_index][k].to] > tmp_min_dist[min_index]+V[min_index][k].dist){
								tmp_min_dist[V[min_index][k].to] = tmp_min_dist[min_index]+V[min_index][k].dist;
								Q.push(Data(V[min_index][k].to,tmp_min_dist[V[min_index][k].to]));
							}
						}
					}
				}

				for(int i = 1; i <= N; i++){
					if(is_mall[i] == false && min_dist_to_market[i] > tmp_min_dist[i]){
						min_dist_to_market[i] = tmp_min_dist[i];
					}
				}
			}
		}

		for(int i = 1; i <= N; i++){
			ans = max(ans,min_dist_to_market[i]);
		}
	}

	for(int i = 1; i < N; i++){
		for(int k = i+1; k <= N; k++){
			if(road[i][k] != BIG_NUM){
				ans = max(ans,(min_dist_to_market[i]+min_dist_to_market[k]+road[i][k]+1)/2);
			}
		}
	}

	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 41112