#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;
typedef pair<int, int> pii;
const int inf = 1e9;
const double EPS = 1e-8;

int main(){
    int n,m,k;
    cin >> n >> m >> k;
    vector<vector<pii>> adj(n);
    for(int i=0; i<m; i++){
        int a,b,c;
        cin >> a >> b >> c;
        a--; b--;
        adj[a].emplace_back(b, c);
        adj[b].emplace_back(a, c);
    }
    vector<int> s(k);
    for(int i=0; i<k; i++){
        cin >> s[i];
        s[i]--;
    }

    priority_queue<pii> wait;
    vector<int> mincost(n, inf);
    for(int i: s){
        mincost[i] = 0;
        wait.push(pii(0, i));
    }
    while(!wait.empty()){
        int cost = -wait.top().first;
        int pos = wait.top().second;
        wait.pop();
        if(cost > mincost[pos]) continue;
        for(auto next: adj[pos]){
            int npos = next.first;
            int ncost = next.second +cost;
            if(ncost < mincost[npos]){
                mincost[npos] = ncost;
                wait.push(pii(-ncost, npos));
            }
        }
    }
    int ans = 0;
    for(int i=0; i<n; i++){
        for(auto p: adj[i]){
            int j = p.first;
            int d = p.second;
            int diff = abs(mincost[i] -mincost[j]);
            if(diff == d){
                ans = max(ans, max(mincost[i], mincost[j]));
            }else{
                ans = max(ans, max(mincost[i], mincost[j]) +(d-diff+1)/2);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

