#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
#define int long long
struct Edge{
    int u,v,cost;
};
vector<P> graph[110000];
int dist[110000];
int dist2[110000];
const int INF = 1001001001001LL;
signed main()
{
    int n,m,k;cin >> n >> m >> k;
    rep(i,m){
        int a,b,l;cin >> a >> b >> l;
        a--;b--;
        graph[a].push_back(P(b,l));
        graph[b].push_back(P(a,l));
    }
    priority_queue<P,vector<P>,greater<P>> q;
    rep(i,110000){
        dist[i] = INF;
        dist2[i] = INF;
    }
    rep(i,k){
        int s;cin >> s;
        s--;
        dist[s] = 0;
        dist2[s] = 0;
        q.emplace(0,s);
    }
  
    while(q.size()){
        auto p = q.top();q.pop();
        int v = p.second,d = p.first;
        if(dist2[v] < d)continue;
        for(auto next:graph[v]){
            int d2 = d+next.second;
            if(dist[next.first] > d2){
                swap(dist[next.first],d2);
                q.push(P(dist[next.first],next.first));
            }
            if(dist2[next.first] > d2 && dist[next.first] < d2){
                dist2[next.first] = d2;
                q.push(P(dist2[next.first],next.first));
            }

            
        }
    }

    int ans = 0;
    rep(i,n)rep(j,graph[i].size()){
        auto hoge = graph[i][j];
        int res = (dist[i]  + dist[hoge.first]+1 + hoge.second)/2;
        ans = max(ans,res);

    }
    cout << ans << endl;




    return 0;
}
