def bins(a, n, st, en)
  mid = (st+en)/2
  if a[[0,mid-1].max] == n
    return [0,mid-1].max
  elsif a[mid]==n || st==en || (a[[0,mid-1].max] < n && n < a[mid])
    return mid
  else
    if n < a[[0,mid-1].max]
      return bins(a, n, st, mid-1)
    else
      return bins(a, n, mid+1, en)
    end
  end
end

while (ln = gets.to_i) != 0
  n = gets.to_i
  m = gets.to_i
  d = (n-1).times.map{gets.to_i}
  k = m.times.map{gets.to_i}
  
  d.push(0)
  d.sort!
  ans = 0
  for i in 0..(m-1)
    if k[i] == 0
      ans += 0
    elsif d[n-1] <= k[i]
      ans += [ln-k[i], k[i]-d[n-1]].min
    else
      id = bins(d, k[i], 0, n-1)
      ans += [d[id]-k[i], k[i]-d[id-1]].min
    end
  end
  puts ans
end
