n, m, l = gets.split.map(&:to_i)
d = []
m.times do
  d.push(gets.to_i)
end

min = 10000000000000000

d.permutation(m).each do |combi|
  sum = 0
  pos = l
  combi.each do |to|
    mov1 = (pos - to).abs
    mov2 = n - mov1
    sum += [mov1, mov2].min
    pos = to
  end
  min = sum if min > sum
end

puts min * 100