import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(scanner.hasNext()){
			int[] a = new int[4];
			int[] b = new int[4];
			int hit = 0;
			int brow = 0;
			
			for(int i=0; i<4; i++){
				a[i] = scanner.nextInt();
			}
			for(int i=0; i<4; i++){
				b[i] = scanner.nextInt();
			}
			
			for(int i=0; i<4; i++){
				if(a[i] == b[i]){
					hit++;
				}
				for(int j=0; j<4; j++){
					if(i!=j && a[i]==b[j]){
						brow++;
					}
				}
			}
			System.out.println(hit + " " + brow);
			
		}
	}
}