#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;

int main(){
	int d,n,m;
	int place[100010],k[10000];
	while(cin >> d , d){
		cin >> n; cin >> m;
		place[0] = 0;
		place[n] = d;
		for(int i=1;i<n;i++){
			cin >> place[i];
		}
		n++;
		sort(place,place+n);
		for(int i=0;i<m;i++){
			cin >> k[i];
		}
		int ans = 0;
		for(int i=0;i<m;i++){
			int check = k[i];
			int* pos1 = lower_bound(place,place+n+2,check);
			int* pos2 = pos1 - 1;
			ans += min(*pos1 - check,check - *pos2);
		}
		cout << ans << endl;
	}
}