
#include<iostream>
#include<stdio.h>
#include<algorithm>

using namespace std;

int main(){
	pair<int,int>  p1,p2,p3,p4;
	int a[4];
	int b[4];

	while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]) != EOF){
		int hit = 0;
		int blow = 0;
		//scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);

		for(int i=0;i<4;i++){
			scanf("%d",&b[i]);
				if(a[i] == b[i]){
					hit++;
				}
				for(int j=0;j<4;j++){
						if(b[i] == a[j] and a[i] != b[i]){
							blow++;
						}
				}
		}
	cout << hit << " " << blow << endl;
	}
	return 0;
}