#include <iostream>
#include <vector>
using namespace std;

int main() {

    int n;
    cin >> n;
    vector< vector< int > > p(3, vector< int >(n + 1, 0));
    for(int i = 0; i < 3; i++) {
        int size; cin >> size;
        for(int j = 0; j < size; j++) {
            int a; cin >> a;
            p[i][a]++;
        }
    }

    int sum = 0;
    vector< int > used(n + 1, 0);
    for(int i = 1; i <= n; i++) {
        if((!p[0][i] && p[2][i] || p[1][i] && p[2][i]) && !used[i]) {
            sum++;
            used[i]++;
        }
    }
    cout << sum << endl;
}