#include<iostream>
#include<algorithm>
using namespace std;
int*t,n,m,d,i,s[99999];
int main(){
	for(;cin>>d>>n>>m;cout<<i<<'\n'){
		for(s[i=n]=d;--i;)
			cin>>s[i];
		for(sort(s,s+n);m--;t=upper_bound(s,s+n,d),i+=min(*t-d,d-t[-1]))
			cin>>d;
	}
}