import scala.annotation.tailrec
import scala.collection.{immutable, mutable}
object Main extends App {
  import scala.io.StdIn._
  loop()
  @tailrec def loop(): Unit = {
    val d = readInt()
    if (d == 0) return
    val n = readInt()
    val m = readInt()
    val shops = 0 +: Array.fill(n - 1) {
      readInt()
    }.sorted :+ d
    println(
      Array.fill(m) {
        readInt()
      }.map {
        case 0 ⇒ 0
        case dest ⇒
          val position = lowerBound(shops, dest)
          math.min(shops(position) - dest, dest - shops(position - 1))
      }.sum
    )
    loop()
  }
  @inline def lowerBound(array: Array[Int], value: Int): Int = {
    var left = 0
    var right = array.length
    while (left < right) {
      val mid = (left + right) / 2
      if (array(mid) < value) left = mid + 1
      else right = mid
    }
    right
  }
}
