#include <bits/stdc++.h>

using namespace std;

#define int long long
#define PB push_back
typedef pair<int, int> pii;
static const int INF = 1LL<<61;

int len, n, m, d[100005];

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  while (cin >> len, len) {
    fill(d, d + 100005, INF);
    cin >> n >> m;
    for (int i = 1; i < n; ++i) {
      cin >> d[i];
    }

    d[0] = 0;
    d[n] = len;
    sort(d, d + n + 1);

    int ans = 0;
    for (int i = 0; i < m; ++i) {
      int k, l = 0, r = n + 1;
      cin >> k;

      while (1 <= r - l) {
	int j = (l + r) / 2;

	if (d[j] <= k && k <= d[j + 1]) {
	  if (abs(k - d[j]) < abs(k - d[j + 1]))
	    l = j;
	  else
	    l = j + 1;
	  break;
	}

	if (k < d[j])
	  r = j;
	else
	  l = j + 1;
      }

      ans += abs(k - d[l]);
    }

    cout << ans << endl;
  }
  
  return 0;
}