#include<iostream>
using namespace std;

int main(){

	int n, hit, blow;
	int a[10][2] = {0};

	do{
		hit = 0;
		blow = 0;
		for(int i=1; i<=4; i++){
			if(cin >> n == NULL) return 0;
			a[n][1] = i;
		}

		for(int i=1; i<=4; i++){
			cin >> n;
			if(a[n][1] == i) hit++;
			else if(a[n][1] != 0) blow++;
		}
		cout << hit << " " << blow << endl;
	}while(1);
	
}