#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<iomanip>
 
#define EPS (1e-10)
using namespace std;
#define PI (3.1415926535)
 
int main(){
	int a[4], b[4];
	while(1){
		int hit = 0, blow = 0;
		for(int i = 0; i < 4; i++){
			if(!(cin >> a[i])){
				return 0;
			}
		}
		for(int i = 0; i < 4; i++){
			if(!(cin >> b[i])){
				return 0;
			}
		}

		for(int i = 0; i < 4; i++){
			if(a[i] == b[i]){
				hit++;
			}
			for(int j = 0; j < 4; j++){
				if(a[i] == b[j]){
					blow++;
				}
			}
		}
		blow -= hit;

		cout << hit << ' ' << blow << endl;
	}

	return 0;
}