#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int check[110];
set<int> s;

int main()
{
	int n;
	cin >> n;

	int x, y, z;
	cin >> x;
	vector<int> X(x);
	for (int i = 0; i < x; i++)cin >> X[i];

	cin >> y;
	vector<int> Y(y);
	for (int i = 0; i < y; i++)cin >> Y[i];

	cin >> z;
	vector<int> Z(z);
	for (int i = 0; i < z; i++)cin >> Z[i];
		
	sort(X.begin(), X.end());
	sort(Y.begin(), Y.end());
	sort(Z.begin(), Z.end());

	vector<int> v1,v2,v3;
	set_intersection(Y.begin(), Y.end(), Z.begin(), Z.end(), back_inserter(v1));
	set_difference(Z.begin(),Z.end(),X.begin(),X.end(),back_inserter(v2));
	set_union(v1.begin(),v1.end(),v2.begin(),v2.end(),back_inserter(v3));

	cout << v3.size() << endl;
	return 0;
}