#include<iostream>

using namespace std;

int main(){
	
	int A[4] = {};
	int B[4] = {};
	
	int yes = 0;
	int no = 0;
	
	while( cin >> A[0]) {
	for(int i=1;i<4;i++)
	cin >> A[i];
	
	for(int i=0;i<4;i++)
	cin >> B[i];
	
	for(int i=0;i<4;i++)
	for(int j=0;j<4;j++)
	if( A[i] == B[j] ) {
		
		if( i == j) 
		yes++;
		
		else
		no++;
	}
	cout << yes << " " << no << "\n"; 
}
    return 0;
}
