#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0
//#define int ll

#define MAX 3005

double minc[MAX];
vector<pair<double, double> > G[MAX];

signed main(){
  int n,m,k;
  cin>>n>>m>>k;
  for(int i=0; i<m; i++){
    int a,b,c;
    cin>>a>>b>>c;
    G[a].push_back(mk(b,c));
    G[b].push_back(mk(a,c));
  }
  for(int i=0; i<=n; i++) minc[i]=INF;
  
  for(int u=0; u<k; u++){
    double city[MAX];
    bool come[MAX];
    for(int i=1; i<=n; i++){
      city[i]=INF;
      come[i]=false;
    }
    int a;
    cin>>a;
    priority_queue<P,vector<P>, greater<P> > que;
    que.push(mk(0,a));
    city[a]=0;
    while(!que.empty()){
      int q=que.top().second; que.pop();
      come[q]=true;
      for(int i=0; i<G[q].size(); i++){
        int v=G[q][i].first;
        int c=G[q][i].second;
        if(come[v]) continue;
        if(city[v]>city[q]+c){
          city[v]=city[q]+c;
          que.push(mk(city[v],v));
        }
      }
    }
    for(int i=1; i<=n; i++){
      minc[i]=min(minc[i],city[i]);
    }
  }
  
  double max_ans=-1;
  for(int i=1; i<=n; i++){
    for(int j=0; j<G[i].size(); j++){
      int to=G[i][j].first;
      max_ans=max(max_ans,round((minc[i]+minc[to]+G[i][j].second)/2));
      max_ans=max(max_ans,(double)minc[i]);
    }
  }
  cout<<max_ans<<en;
}




