#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
	while (true) {
		long long d, n, m;
		cin >> d;
		if (d == 0) return 0;
		cin >> n >> m;
		vector<ll>s(n + 1);
		vector<ll>k(m);
		s[0] = 0;
		for (int i = 1; i < n; i++) cin >> s[i];
		s[n] = d;
		for (int i = 0; i < m; i++) cin >> k[i];
		sort(s.begin(), s.end());
		ll res = 0;
		for (int i = 0; i < m; i++) {
			if (k[i] == 0) continue;
			int up = lower_bound(s.begin(), s.end(), k[i]) - s.begin();
			res += min(s[up] - k[i], k[i] - s[up - 1]);
		}
		cout << res << endl;
	}
	return 0;
}
