#include <iostream>
using namespace std;
int main()
{
	int A[4] = {}, B[4] = {};
	int hit, blow;
	while (cin >> A[0] >> A[1] >> A[2] >> A[3] >> B[0] >> B[1] >> B[2] >> B[3]){
		hit = blow = 0;
		for (int i = 0; i < 4; ++i){
			if (A[i] == B[i]){
				++hit;
				continue;
			}
			for (int j = 0; j < 4; ++j){
				if (i == j) continue;
				if (A[i] == B[j]) ++blow;
			}
		}
		cout << hit << " " << blow << "\n";
	}
	return 0;
}