#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
	int numa[4];
	int numb[4];
	int a, i, j;
	int hit, blow;
	

	while((cin.get()) != istream::traits_type::eof())
	{	
		for(i = 0; i < 4; i++)
		{
			cin >> numa[i];
		}
		
		for(i = 0; i < 4; i++)
		{
			cin >> numb[i];
		}
		
		
		hit = 0;
		
		for(i = 0; i < 4; i++)
		{
			if(numa[i] == numb[i])
			{
				hit = hit + 1;
			}
		}
		
		blow = 0;
		for(i = 0; i < 4; i++)
		{
			for(j = 0; j < 4; j++)
			{
				if(numa[i] == numb[j] && i != j)
				{
					blow = blow + 1;
				}
			}
		}
		
		cout << hit << " " << blow << endl;
	}
		
	return 0;
		
}