import Control.Monad (replicateM)
import Data.Array (Array,listArray,bounds,(!))
import Data.List (sort)

main = do
    d <- readLn
    if d == 0 then return () else do
        n <- readLn
        m <- readLn
        ps <- replicateM (n-1) readLn >>=
                return . listArray (0,n) . sort . ([0,d] ++)
        ks <- replicateM m readLn
        print $ sum $ map (distance ps) ks
        main

distance :: Array Int Int -> Int -> Int
distance ps d = distance' a b
    where
    (a,b) = bounds ps

    distance' a b
        | b - a == 1
            = min (d - ps ! a) (ps ! b - d)
        | d >= ps ! m
            = distance' m b
        | otherwise
            = distance' a m
        where
        m = (a+b) `div` 2