#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef pair <int,int> P;
typedef long long ll;
int main(){

  int d,n,m;
  while(cin>>d,d){
    cin>>n>>m;
  int D[100001],M[100001];;
  D[0]=0,D[n]=d;
  for(int i=1;i<n;i++) cin>>D[i];
  for(int i=0;i<m;i++) cin>>M[i];
  sort(M,M+m);
  sort(D,D+n+1);

  ll ans=0;
  int pos=1;
  for(int i=0;i<m;i++){
    while(D[pos]<=M[i])pos++;
    ans+=min(abs(D[pos]-M[i]),abs(D[pos-1]-M[i]));
  }
  cout <<ans<<endl;
  }
  return 0;
}