#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void){
  long long d;
  while(cin>>d,d){
    int n,m;
    long long ans=0;
    cin>>n>>m;
    vector<long long> s(n),k(m);
    s[0]=0;
    for(int i=1;i<n;++i)cin>>s[i];
    for(int i=0;i<m;++i)cin>>k[i];
    
    sort(s.begin(),s.end());
    vector<long long> div(n+1);
    div[0]=-1;
    for(int i=0;i<n;++i){
    	div[i+1]=(((i+1==n)?d:s[i+1])-s[i])/2+s[i];
    }
    
    for(int i=0;i<m;++i){
    	for(int j=n;j>=0;--j){
    		if(k[i]>div[j]){
    			//cerr<<abs(k[i]-s[j%n])<<" ";
    			ans+=abs(s[j%n]+((j==n)?d:0)-k[i]);
    			break;
    		}
    		//cerr<<endl;
    	}
    }
    
    cout<<ans<<endl;
    
  }
  return 0;
}