#include <iostream>
#include <vector>
#include <queue>
#include<map>
#include<algorithm>
#include<set>
#include<iomanip>
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1; i<=n;i++)
#define rrep(i,n) for(int i = n-1;i >=0;i--)
#define ALL(a) a.begin(),a.end()
#define PI  acos(-1)
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
typedef long long int ll;
typedef long double ld;
const int MOD = 1e9 + 7;
int dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 }, sum = 0, h, w;
int main() {
    int n, x, y, z,a,b=0,c; cin >> n; vector<int> t(n, 0);
    cin >> x; rep(i, x) {
        cin >> a; t[a - 1]++;
    }cin >> y; rep(i, y) {
        cin >> a; t[a - 1] += 2;
    }cin >> z; rep(i, z) {
        cin >> a; t[a - 1] += 4;
    }rep(i, n) {
        if ((t[i] % 2 == 0 || (t[i] & 2)) && (t[i] & 4)) b++;
    }cout << b << endl;
}
