#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

using namespace std;

int shop[100001] = {0};
int main(){
    int d;
    while(scanf("%d",&d),d){
        int n;
        scanf("%d",&n);

        int m;
        scanf("%d",&m);

        memset(shop,0,sizeof(shop));

        shop[0] = 0;
        shop[1] = d;

        for(int i = 2;i < n+1; i++){
            scanf("%d",&shop[i]);
        }
        sort(shop,shop+1+n);

        int ans = 0;
        for(int i = 0;i < m; i++){
            int x = 0;
            scanf("%d",&x);

            int a = abs(x - *(lower_bound(shop,shop+n+1,x)-1));
            int b = abs(x - *(lower_bound(shop,shop+n+1,x)));

            int mi = min(a,b);
            ans += mi;
        }

        printf("%d\n",ans);
    }
    return 0;
}