#include <iostream>
typedef long long lll;
using namespace std;




int main() {
    
    int n,s,r,i,a[10],x;
    
    cin >> n >> s >> r;
    for (i=1; i<=n; i++)
        a[i]=0;
    for (i=1; i<=s; i++) {
        cin >> x;
        a[x]--; }
        
    for (i=1; i<=r; i++) {
        cin >> x;
        a[x]++;
        }/*
    for (i=1; i<=n; i++)
        cout << a[i];*/
    
    int l=0, rj=0;    
    bool bul=false;
    for (i=1; i<=n; i++)
        if (a[i]==-1) { 
           if (i==1) bul=false;
           else if (a[i-1]<1) bul=false;
           else { //cout << i << endl;
                bul=true;
                a[i-1]--;
                a[i]++; continue;}
           if (bul==false) { //cout << i << endl; 
              if (i!=n) if (a[i+1]==1) {
                 bul=true;
                 a[i+1]--;
                 a[i]++; continue;} }
           if (bul==false) rj++; 
           }
    
    cout << rj;
            
    
    
    

    //system ("pause");
    return 0;
}
