#include<stdio.h>
int main(void) {
	int SUM = 0, N, X, a = 0, Y, b = 0, Z, c = 0, are = 0, AA[101] = { 0 }, BB[100] = { 0 }, CC[100] = { 0 }, hanbetu = 0;
	scanf("%d", &N);
	for (are = 0; are < N; are++) {
		AA[are] = 1;
		if (are == 99) {
			break;
		}
	}
	are = 0;
	scanf("%d", &X);
	for (are = 0; are < X; are++) {
		scanf("%d", &a);
		AA[a-1] = 2;
		if (a == 100) {
			AA[a] = 1;
			a = a - 1;
			AA[a] = 2;
		}
	}
	are = 0;
	scanf("%d", &Y);
	for (are = 0; are < Y; are++) {
		scanf("%d", &b);
		BB[b-1] = 1;
	}
	are = 0;
	scanf("%d", &Z);
	for (are = 0; are < Z; are++) {
		scanf("%d", &c);
		CC[c-1] = 1;
	}
	for (hanbetu = 0; hanbetu < 100; hanbetu++) {
		if (AA[hanbetu] == 1 && CC[hanbetu] == 1) {
			SUM = SUM + 1;
		}
	}
	hanbetu = 0;
	for (hanbetu = 0; hanbetu < 100; hanbetu++) {
		if (BB[hanbetu] == 1 && CC[hanbetu] == 1) {
			SUM = SUM + 1;
			if (AA[hanbetu] == 1 && CC[hanbetu] == 1) {
				SUM = SUM - 1;
			}
		}
	}
	printf("%d\n", SUM);
	return 0;
}
