### subroutines

def lower_bound(arr, key, i0 = 0, i1 = arr.length)
  lb = i0 - 1
  ub = i1

  while lb + 1 < ub
    m = (lb + ub) / 2
    if arr[m] <= key
      lb = m
    else
      ub = m
    end
  end
  lb
end

### main

loop do
  d = gets.strip.to_i
  break if d == 0

  n = gets.strip.to_i
  m = gets.strip.to_i

  di = [0, d]
  for i in (2..n)
    di << gets.strip.to_i
  end
  di.sort!
  #p di

  ks = m.times.map{gets.strip.to_i}
  total = 0

  for k in ks
    pos = lower_bound(di, k)
    #p [k, pos]
    total += [k - di[pos], di[pos + 1] - k].min
  end

  puts total
end