#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> ii;
typedef vector <int> vi;
typedef double ld;
#define X first
#define Y second
#define mk make_pair
#define pb push_back
#define Rep(i, n) for(int i = 0; i < int(n); i ++)
#define Rep1(i, n) for(int i = 1; i <= int(n); i ++)
#define all(x) (x).begin(), (x).end()
const int MOD = (int) 1e9 + 7;
const int base = 31;
void MAIN();
int main(){
    //freopen("input.txt", "r", stdin);
    ios:: sync_with_stdio(false); cin.tie(0);
    MAIN();
    return 0;
}
////////////////////////////////////////////////////////////////////////

const int N = 1 << 12;

int n, m, h;
vector <ii> G[N];
int d[N];

void MAIN(){
    cin >> n >> m >> h;
    Rep1(i, m){
        int u, v, c;
        cin >> u >> v >> c;
        G[u].pb(ii(v, c));
        G[v].pb(ii(u, c));
    }
    int ans = 0;
    priority_queue <ii> q;
    memset(d, 0x3f, sizeof d);
    while(h --){
        int u;
        cin >> u;
        d[u] = 0;
        q.push(ii(-d[u], u));
    }
    while(!q.empty()){
        int u = q.top().Y, r = -q.top().X; q.pop();
        if(d[u] != r) continue;
        ans = d[u];
        Rep(i, G[u].size()){
            int v = G[u][i].X, c = G[u][i].Y;
            if(d[v] > d[u] + c){
                d[v] = d[u] + c;
                q.push(ii(-d[v], v));
            }
        }
    }
    Rep1(u, n) Rep(i, G[u].size()){
        int v = G[u][i].X, c = G[u][i].Y;
        if(abs(d[u] - d[v]) <= c) ans = max(ans, (d[u] + d[v] + c + 1) / 2);
    }
    cout << ans << endl;
}