def seach (place, ary, dist, top, last)
  half = (last+top)/2
  if place < ary[half]
    seach(place, ary, dist, top, half-1)
  elsif ary[half+1] < place
    seach(place, ary, dist, half+2, last)
  else 
    pa = place - ary[half]
    ap = ary[half+1] - place
    if pa < ap
      return pa
    end
    return ap
  end
end

d = gets.chomp.to_i #??¨???
while d != 0  
  n = gets.chomp.to_i #????????°
  m = gets.chomp.to_i #??¨?????°

  dAry = [] #????????????
  dAry[0] = 0
  for i in 1..n-1
    dAry[i] = gets.chomp.to_i
  end
  dAry[dAry.length] = d
  dAry = dAry.sort

  sum = 0
  kAry = [] #?????????
  for i in 0..m-1
    j = gets.chomp.to_i
    sum += seach(j, dAry, d, 0, dAry.length-1)
  end
  
  puts sum

  d = gets.chomp.to_i #??¨???
end