#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include<list>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e9
typedef long long ll;
using namespace std;

int main() {
    int n; cin >> n;
    vector<int> a;
    vector<int> b;
    vector<int> c;
    int x,y,z;
    cin >> x;
    rep(i,x) {
        int num; cin >> num;
        a.push_back(num);
    }
    cin >> y;
    rep(i,y) {
        int num; cin >> num;
        b.push_back(num);
    }
    cin >> z;
    rep(i,z) {
        int num; cin >> num;
        c.push_back(num);
    }

    vector<int> ans;
    rep(i,z) {
        bool flag = true;
        rep(j,x) {
            if(c[i] == a[j]) flag = false;
        }
        if(flag) ans.push_back(c[i]);
    }

    rep(i,y) {
        rep(j,z) {
            if(b[i]==c[j]) ans.push_back(b[i]);
        }
    }
    sort(ALL(ans));
    ans.erase(unique(ALL(ans)),ans.end());

    cout << ans.size() << endl;


    return 0;
}
