### constant

MAX_INT = 1 << 30

### main

n, m, k = gets.strip.split(' ').map{|s| s.to_i}

edges = n.times.map{[]}
nbrs = n.times.map{[]}

m.times do
  a, b, l = gets.strip.split(' ').map{|s| s.to_i}
  a -= 1
  b -= 1

  edges[a][b] = edges[b][a] = l
  nbrs[a] << b
  nbrs[b] << a
end
#p edges
#p nbrs

sms = n.times.map{false}

k.times do
  si = gets.strip.to_i
  sms[si - 1] = true
end
#p sms

dists = n.times.map{MAX_INT}
q = []

for st in (0...n)
  if sms[st]
    q << st
    dists[st] = 0
  end
end

while ! q.empty?
  u = q.min{|a, b| dists[a] <=> dists[b]}
  q.delete u

  for v in nbrs[u]
    dv = dists[v]
    d = dists[u] + edges[u][v]
    if dists[v] > d
      dists[v] = d
      q << v if dv >= MAX_INT
    end
  end
end

max_dist = 0

for s0 in (0...n)
  d0 = dists[s0]
  for s1 in nbrs[s0]
    d1 = dists[s1]
    l = edges[s0][s1]

    d = (l + d1 - d0 + 1) / 2 + d0
    max_dist = d if max_dist < d
  end
end

puts max_dist