#include <cstdio>

#include <algorithm>

using namespace std;

int d,n,m;
int main(void){
  scanf("%d",&d);
  while(d!=0){
    scanf("%d%d",&n,&m);
    int  dates[100005];
    int i,co=0;
    int me;
    for(i=0;i<n-1;i++){
      scanf("%d",&(dates[co]));
      co++;
    }
    dates[co]=0;co++;
    dates[co]=d;co++;
    sort(dates,dates+co);
    int ans=0;
    int mi,hi,tyu;
    for(i=0;i<m;i++){
      scanf("%d",&me);
      mi=0;hi=co-1;
      while(hi-mi>1){
	tyu=(mi+hi)/2;
	if(dates[tyu]<=me){
	  mi=tyu;
	}
	else{
	  hi=tyu;
	}
      }
      mi=me-dates[mi];
      hi=dates[hi]-me;
      ans+=(mi<hi)?mi:hi;
    }
    printf("%d\n",ans);
    scanf("%d",&d);
  }
  return 0;
}