#include <bits/stdc++.h>

using namespace std;
using i64 = int64_t;

signed main(){
    
    int n;
    cin >> n;
    vector<int> m(3);
    vector<vector<int>> a(3);
    vector<int> d(n, 0);
    for(int i = 0; i < 3; ++i){
        cin >> m[i];
        a[i].resize(m[i]);
        for(int j = 0; j < m[i]; ++j){
            cin >> a[i][j];
            d[--a[i][j]] |= (1 << i);
        }
    }
    int ans = 0;
    for(auto& x : d)
        if(x == 4 || x == 6 || x == 7)
            ++ans;
    cout << ans << endl;
    
    
    return 0;
}
