#include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	std::vector<int> a(4);
	std::vector<int> b(4);

#if INPUT_FROM_FILE
	//std::ifstream ifs("test.txt");
	FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(fscanf(fp, "%d %d %d %d", &a[0], &a[1], &a[2], &a[3]) != EOF){
#else
	while(scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]) != EOF){
#endif
		int hit = 0;
		int blow = 0;
		std::vector<int> aa;
		std::vector<int> bb;
#if INPUT_FROM_FILE
		fscanf(fp, "%d %d %d %d", &b[0], &b[1], &b[2], &b[3]);
#else
		scanf("%d %d %d %d", &b[0], &b[1], &b[2], &b[3]);
#endif
		for(int i = 0; i < 4; i++){
			if(a[i] == b[i]){
				hit++;
			}
			else{
				aa.push_back(a[i]);
				bb.push_back(b[i]);
			}
		}

		for(unsigned int i = 0; i < aa.size(); i++){
			for(unsigned int j = 0; j < bb.size(); j++){
				if(aa[i] == bb[j]){
					blow++;
				}
			}
		}
		std::cout << hit << " " << blow << std::endl;
	}
	
	return 0;
}
