#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>

using namespace std;

int main(void) {

	int hit = 0, blow = 0;
	int num[4],data[4];

		for (int i = 0; i < 4; i++) {
			cin >> num[i];
		}
		for (int i = 0; i < 4; i++) {
			cin >> data[i];
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 4; j++) {
				if (i == j && num[i] == data[j])
					hit++;
				else if (num[i] == data[j])
					blow++;
			}
		}
		cout << hit << " " << blow << endl;
		hit = 0, blow = 0;
	

	return 0;
}