#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

int main(void)
{
	int N, X, Y, Z;
	map<int, int>mp;
	cin >> N;
	cin >> X;
	for (int i = 0; i < X; ++i) {
		int a;
		cin >> a;
		mp[a] += 1;
	}
	cin >> Y;
	for (int i = 0; i < Y; ++i) {
		int b;
		cin >> b;
		mp[b] += 2;
	}
	cin >> Z;
	for (int i = 0; i < Z; ++i) {
		int c;
		cin >> c;
		mp[c] += 4;
	}
	int ans = 0;
	for (auto p : mp) {
		if (p.second == 7 || p.second == 6 || p.second == 4) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


