#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	long long d, n, m;
	while (cin >> d&&d != 0) {
		cin >> n >> m;
		int a[100000] = { 0 }, sum = 0;
		for (int i = 1; i < n; i++) 
			cin >> a[i];
		a[n] = d;
		sort(a, a + n+1);
		for (int i = 0; i < m; i++) {
			int b, s=0, e=n, t;
			cin >> b;
			while (e - s > 1) {
				t = (e + s) / 2;
				if (a[t] < b) 
					s = t;
				else if (a[t] > b) 
					e = t;
				if (a[t] == b) {
					s = t;
					e = t;
				}
			}
			sum += min(b - a[s], a[e] - b);
		}
		cout << sum << endl;
	}
}