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

int main() {

	int n, x, y, z;
	int a[100], b[100], c[100];

	cin >> n;

	cin >> x;
	for(int i = 0; i < x; i++)
		cin >> a[i];

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

	cin >> z;
	for(int i = 0; i < z; i++)
		cin >> c[i];

	sort(a, a + x);
	sort(b, b + y);
	sort(c, c + z);

	int p = 0, q = 0, r = 0, m = 0;

	for(int i = 1; i <= n; i++){
		if(b[q] == i && c[r] == i){
			m++;
			q++;
			r++;
			if(a[p] == i)
				p++;
		}
		else if (a[p] != i && b[q] != i && c[r] == i){
			m++;
			r++;
		}
		else{
			if(a[p] == i)
				p++;
			if(b[q] == i)
				q++;
			if(c[r] == i)
				r++;
		}
	}

	cout << m << endl;

	return 0;
}
