#include <bits/stdc++.h>
// #include "ane.cpp"

const int INF  = 1e9;
const long long INFLL = 1e18;
const int NMAX = 3005;
const int MMAX = 1e5 + 5;
const int KMAX = 3005;
const int MOD  = 1e9 + 7;
using namespace std;

// comment to disable debug functions
// #define DEBUG

// frequently used macros

#if __cplusplus >= 201103L
#define ALL(v) begin(v),end(v)
#define SORT(v) sort(begin(v), end(v))
#define FIND(v,x) find(begin(v), end(v), (x))
#else
#define ALL(v) (v).begin(),(v).end()
#define SORT(v) sort(v.begin(), v.end())
#define FIND(v,x) find(v.begin(), v.end(), (x))
#endif

#define MEMNEXT(from, to) do{ memmove((to), (from), sizeof(from)); \
memset((from), 0, sizeof(from)); } while(0)
#ifdef DEBUG
#define DUMP(x) do{ std::cerr << "(DUMP) " << (#x) << ": " << x << std::endl; }while(0)
#else
#define DUMP(x) do{}while(0)
#endif

// frequent used aliases
typedef long long ll;
typedef pair<int, int> p;
typedef pair<ll, int> pl;
typedef pair<ll, ll> pll;
typedef vector<int> vec;
typedef vector<ll> vecll;
typedef vector<vec> mat;
typedef vector<vecll> matll;

// frequently used constants
static const int di[] = {-1, 0, 1, -1, 1, -1, 0, 1};
static const int dj[] = {-1, -1, -1, 0, 0, 1, 1, 1};

// frequently used structs
struct edge{
  int to,cost;
};

// printf for debug
#ifndef DEBUG
void debug(const char* format, ...){}
#else
void debug(const char* format, ...){
  va_list arg;
  va_start(arg, format);
  vprintf(format, arg);
  va_end(arg);
}
#endif

// std::fill of multi dimensions
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
  std::fill( (T*)array, (T*)(array+N), val );
}

// binary search
ll BSearch(ll _begin, ll _end, bool (*f)(int)){
  ll mid;
  while(_end - _begin > 1LL) {
  mid = (_begin + _end) / 2LL;
  if(f(mid)) {
    debug("BSearch: f(%d) == true\n", mid);
    _end = mid;
  }
  else
  {
    debug("BSearch: f(%d) == false\n", mid);
    _begin = mid;
  }
  }
  return _end;
}


ll N,M,K,A,B,C,D;
int d[NMAX], dfrom[NMAX] = {};

std::vector<edge> G[NMAX];
int shop[KMAX] = {};
typedef pair<int, pair<int, int> > pp;
priority_queue<pp, vector<pp>, greater<pp> > que;

int ans = 0;

void solve(){
  // main algorithm
  while(!que.empty()) {
    int  dd = que.top().first;
    int t = que.top().second.second, f = que.top().second.first;
    que.pop();
    if(d[t] <= dd) continue;
    d[t] = dd;
    dfrom[t] = f;
    for(auto&& e : G[t]) {
      if (d[e.to] > dd + e.cost)
      {
        que.push(pp{dd + e.cost, p(t, e.to)});
      }
    }
  }
  // calc max (including midpoint)
  for (int i = 1; i <= N; ++i)
  {
    for (auto e: G[i])
    {
      ans = max(ans, max(d[i], d[e.to]));
      if(dfrom[i] != e.to && dfrom[e.to] != i){
        ans = max(ans, (d[i] + d[e.to] + e.cost + 1) / 2);
        DUMP(ans);
        DUMP(i);
        DUMP(e.to);
      }
    }
  }
}
void debug(){
  // output debug information
  cout << "d:\n";
  for (int i = 0; i < N; ++i)
   {
     cout << d[i+1] << " ";
   }
  cout << endl;
  cout << "dfrom:\n";
  for (int i = 0; i < N; ++i)
   {
     cout << dfrom[i+1] << " ";
   }
  cout << endl;
}
void answer(){
  // output answer
  printf("%d\n", ans);
}
int main(int argc, char const *argv[])
{
  // operate inputs

  Fill(d, INF);
  scanf("%lld%lld%lld", &N,&M, &K);
  for (int i = 0; i < M; ++i)
  {
    int f,t,c;
    scanf("%d%d%d", &f, &t, &c);
    G[f].push_back((edge){t, c});
    G[t].push_back((edge){f, c});
  }
  for (int i = 0; i < K; ++i)
  {
    scanf("%d", &shop[i]);
    que.push(pp(0, p(0, shop[i])));
  }
  solve();
  #ifdef DEBUG
  debug();
  #endif
  answer();

  return 0;
}

Measured memory_bytes: 7464