#include <iostream>
#include <string>

int main(){
    int runs =0;
    int i,j;
    int hits=0;
    int blows=0;
    int player1[4]; 
    int player2[4]; 
	while(4==scanf("%d %d %d %d", &player1[0],&player1[1],&player1[2],&player1[3])){
	    
	    scanf("%d %d %d %d", &player2[0],&player2[1],&player2[2],&player2[3]);
	    hits=0;
	    blows=0;
	    for(i=0;i<4;i++){
	        if(player1[i]==player2[i]) hits++;
	        for(j=i;j<4;j++){
	            if(player1[i]==player2[j]) blows++;
	        }
	    }
	    blows-=hits;
	    if(runs!=0) printf("\n");
	    runs++;
	    printf("%d %d",hits,blows);
	}  
	return 0;
}