#include<bits/stdc++.h>
#define int long long
#define PB push_back
#define MP make_pair
#define fi first
#define se second
using namespace std;
static const int inf = 1ll<<60;
typedef pair<int,int> pii;

struct edge{
    int to,cost;
    edge(){}
    edge(int p1,int p2){
        to=p1;
        cost=p2;
    }
};


int N,M,K;
vector<edge> G[3005];
double d[3005];

void dijkstra(int s){
    priority_queue<pii,vector<pii>,greater<pii> > que;
    d[s]=0;
    que.push(pii(0,s));
    while(!que.empty()){
        pii p=que.top();
        que.pop();
        int v=p.se;
        if(p.fi>d[v])continue;
        for(int i=0;i<G[v].size();++i){
            edge e=G[v][i];
            if(d[e.to]>d[v]+e.cost){
                d[e.to]=d[v]+e.cost;
                que.push(pii(d[e.to],e.to));
            }
        }
    }
}

double ans=0.0;

signed main(){
    cin>>N>>M>>K;
    for(int i=0;i<M;++i){
        int a,b,c;
        cin>>a>>b>>c;
        a--;b--;
        G[a].PB(edge(b,c));
        G[b].PB(edge(a,c));
    }
    fill(d,d+3000,inf);
    for(int i=0;i<K;++i){
        int shop;
        cin>>shop;
        shop--;
        dijkstra(shop);
    }
    for(int i=0;i<N;++i){
        for(int j=0;j<G[i].size();++j){
            edge e=G[i][j];
            int D=abs(d[i]-d[e.to]);
            ans=max(ans,d[i]+(e.cost-D)/2.0);
        }
    }
    cout<<round(ans)<<endl;
}