#include<iostream>

using namespace std;

int main(void)
{
	int a1,a2,a3,a4,b1,b2,b3,b4;
	while(cin>>a1>>a2>>a3>>a4>>b1>>b2>>b3>>b4)
	{
		int hit,blow;
		hit=blow=0;
		if(a1==b1) hit++;
		else if(a1==b2||a1==b3||a1==b4) blow++;
		if(a2==b2) hit++;
		else if(a2==b1||a2==b3||a2==b4) blow++;
		if(a3==b3) hit++;
		else if(a3==b1||a3==b2||a3==b4) blow++;
		if(a4==b4) hit++;
		else if(a4==b1||a4==b2||a4==b3) blow++;
		cout<<hit<<" "<<blow<<endl;
	}
}