#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(n);i++)

int main(){
	int n,m,d,k;
	int dist[100001];
	while(cin>>d&&d){
		int ans=0;
		cin>>n>>m;
		rep(i,n-1){
			cin>>dist[i+1];
		}
		sort(dist+1,dist+n);
		dist[0] = 0;
		dist[n] = d;
		while(m--){
			cin>>k;
			int i = upper_bound(dist,dist+n+1,k)-dist;
			ans += min(dist[i]-k, k-dist[i-1]);
		}
		cout<<ans<<endl;
	}
	return 0;
}