import scala.collection.mutable
import scala.io.StdIn._
object Main extends App {

  val Array(n, m, k) = readLine.trim.split(' ').map(_.toInt)
  val roads = Array.tabulate(m){_ ⇒
    val Array(a, b, l) = readLine.trim.split(' ').map(_.toInt)
    Road(a - 1, b - 1, l)
  }
  val cities = Array.fill(n){Nil: List[Path]}
  for (Road(a, b, l) ← roads) {
    cities(a) ::= Path(b, l)
    cities(b) ::= Path(a, l)
  }
  val minDistance = Array.fill(n){Int.MaxValue}
  val queue = mutable.PriorityQueue[(Int, Int)]()(Ordering.by[(Int, Int), Int](_._2).reverse)
  for (_ ← 0 until k){
    val s = readInt() - 1
    minDistance(s) = 0
    queue.enqueue(s → 0)
  }
  while (queue.nonEmpty) {
    val (current, cost) = queue.dequeue()
    if (minDistance(current) == cost){
      for (Path(to, length) ← cities(current) if minDistance(to) > cost + length) {
        minDistance(to) = cost + length
        queue.enqueue(to → minDistance(to))
      }
    }
  }
  println(roads.map{
    case Road(a, b, length) ⇒
      val min = Math.min(minDistance(a), minDistance(b))
      val max = Math.max(minDistance(a), minDistance(b))
      val diff = max - min
      (length - diff + 1) / 2 + max
  }.max)
  case class Road(a: Int, b: Int, length: Int)
  case class Path(to: Int, length: Int)
}
