#include <cstdio>
#include <algorithm>
using namespace std;
int l,n,m;
int d[111111];
int main(void){
  while(1){
    scanf("%d",&l); if(!l) break;
    scanf("%d%d",&n,&m);
    for(int i = 1; i < n; i++){
      scanf("%d",d+i);
    }
    d[0] = 0;
    d[n] = l;
    sort(d,d+n+1);
    int sum = 0;
    for(int i = 0; i < m; i++){
      int k;
      scanf("%d",&k);
      int *p = upper_bound(d,d+n+1,k);
      //printf("p:%d\nk:%d\n",*p,k);
      int ret = 1<<29;
      for(int j = 0; j < 2; j++){
	int a = *(p-j);
	a -= k;
	if(a<0) a=-a;
	a = min(a,l-a);
	ret = min(ret,a);
      }
      sum += ret;
    }
    printf("%d\n",sum);
  }
}