#include<iostream>

using namespace std;

int main() {
	
	int A[4] = {};
	int B[4] = {};
	
	while(cin >> A[0]) {
	int hit = 0;
	int blow = 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 )
					hit++;
					
				else
					blow++;
					
		}
		
	}
	
}
	cout << hit << " " << blow << "\n";
}
	return 0;
}
