#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;

int main(){
    int d, n, m;
    while(cin >> d, d){
        cin >> n >> m;
        vector<int> v(n, 0);
        for(int i = 1; i < n; i++)  cin >> v[i];
        v.push_back(v[n-1]-d);
        v.push_back(d);
        sort(v.begin(), v.end());
        int ans = 0;
        while(m-- > 0){
            int k;  cin >> k;
            int x = lower_bound(v.begin(), v.end(), k)-v.begin();
            ans += min(v[x]-k, k-v[x-1]);
        }
        cout << ans << endl;
    }
    return 0;
}
