#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
	std::vector<int> a(4);
	
	while (std::cin >> a[0] >> a[1] >> a[2] >> a[3])
	{
		int hit  = 0;
		int blow = 0;

		for (auto i : a) {
			int b;
			std::cin >> b;
			std::vector<int>::iterator it = find(a.begin(), a.end(), b);
			if (b == a[i]) {
				hit++;
			}
			else if (it != a.end()) {
				blow++;
			}
		}
		std::cout << blow << ' ' << hit<< std::endl;
	}
}