#include<iostream>
using namespace std;
int main() {
	int a[5], b[5];
	int h;
	int br;
	while (cin >> a[1] >> a[2] >> a[3] >> a[4]) {
		br = 0;
		h = 0;
		cin >> b[1] >> b[2] >> b[3] >> b[4];
		for (int i = 1; i <= 4; i++) {
			if (a[i] == b[i]) {
				h = h + 1;
				b[i] = -1;
			}
		}
		for (int i = 1; i <= 4; i++) {
			for (int z = 1; z <= 4; z++) {
				if (a[i] == b[z]) {
					br = br + 1;
					b[z] = -1;
				}
			}
		}
		cout << h << " " << br << endl;
	}
}
