#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#define pb push_back
#define ek cout << endl;

using namespace std;

int main(){
    int n, s, r; cin >> n >> s >> r;
    int des[s], ext[r];
    for(int i=0; i<s; i++) cin >> des[i];
    for(int i=0; i<r; i++) cin >> ext[i];
    
    int kay[n]; memset(kay, 0, sizeof kay);
    for(int j=0; j<s; j++) kay[des[j]-1]--; 
    for(int j=0; j<r; j++) kay[ext[j]-1]++;
    
    
    for(int i=0; i<100; i++){
        for(int j=0; j<n; j++){
            if(j and kay[j]==-1 and kay[j-1]==1){ kay[j]++; kay[j-1]--; }
            if(j<n-1 and kay[j]==-1 and kay[j+1]==1){ kay[j]++; kay[j+1]--; }
        }
    }
    int sol=0;
    for(int i=0; i<n; i++) if(kay[i]==-1) sol++; cout << sol; 
    
    

    //ek system("pause");
    return 0;
}
