#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	freopen("frozen.in", "r", stdin);
	freopen("frozen.out", "w", stdout);
	int n;
	cin >> n;
	vector<int> a(n);
	vector<pair<int, int> > b(n);

	for (int i = 0; i < n; i++)
		cin >> a[i];
	
	for (int i = 0; i < n; i++)
		cin >> b[i].first;

	for (int i = 0; i < n; i++)
		cin >> b[i].second;

	int ans = 2 * n;
	for (int i = 0; i < n; i++)
		ans -= (b[i].first == 0), ans -= (b[i].second == a[i]);
	
	cout << ans;
	return 0;

}