#include<bits/stdc++.h>
using namespace std;
int main(){
  int d, n, m, dist[100002], k[10000];
  while(scanf("%d", &d), d){
    scanf("%d", &n);
    scanf("%d", &m);

    dist[0] = 0;
    for(int i = 1; i < n; i++){
      scanf("%d", &dist[i]);
    }
    dist[n] = d;
    n++;
    sort( dist, dist + n);

    for(int i = 0; i < m; i++){
      scanf("%d", &k[i]);
    }

    int sum = 0;
    for(int i = 0; i < m; i++){
      int& check = k[i]; //チェックするやつ
      int* posA = lower_bound( dist, dist + n + 2, check); //どっちかでしょ(たぶん
      int* posB = posA - 1; 
      sum += min( *posA - check, check - *posB); 
    }
    cout << sum << endl;
  }
}