#include <iostream>
using namespace std;
int main() {
	int n, x, y, z, ans = 0;
	int a[105], b[105], c[105];
	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];
	for (int i = 1; i <= n; i++) {
		int sum = 0;
		for (int j = 0; j < x; j++) {
			if (a[j] == i) sum += 100;
		}
		for (int j = 0; j < y; j++) {
			if (b[j] == i) sum += 10;
		}
		for (int j = 0; j < z; j++) {
			if (c[j] == i) sum += 1;
		}
		if (sum == 111 || sum == 11 || sum == 1) ans++;
	}
	cout << ans << endl;
	return 0;
}