#include "bits/stdc++.h"
using namespace std;
using ld = long double;
const ld eps = 1e-9;


int main() {
	int N; cin >> N;
	vector<bitset<3>>flags(N);
	for (int i = 0; i < 3; ++i) {
		int K; cin >> K;
		while (K--) {
			int a; cin >> a; a--;
			flags[a][i] = true;
		}
	}
	int ans=count_if(flags.begin(),flags.end(),
		[](const bitset<3>&bs) {
		int n = bs.to_ulong();
		return n == 4 || n==6 || n==7;
	});
	cout << ans << endl;
	return 0;
}