import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main{
    public static final int HIT = 0; // ??????????????????????????????
    public static final int BLOW = 1; // ??????????????????????????????

    public static void main(String[] args) throws IOException {

	Scanner sc = new Scanner(System.in);
	ArrayList<int[]> outList = new ArrayList<>();

	while (sc.hasNextLine()) {
	    int[] answer = getNumberArray(sc.nextLine().split(" ")); // ?????????????????????

	    int[] expected = getNumberArray(sc.nextLine().split(" ")); // ?§£??????????????????

	    int[] hitAndBlow = getHitAndBlow(answer, expected);

	    outList.add(hitAndBlow);
	}

	for (int[] hitAndBlow : outList) {
	    System.out.println(hitAndBlow[HIT] + " " + hitAndBlow[BLOW]);
	}
	sc.close();
    }

    /**
     * ??\???????????????????????????0???9???????????????????????????????????????????´??????????????????????
     * 
     * @param input
     * @return
     */
    public static int[] getNumberArray(String[] input) {
	int[] numbers = new int[10]; // 0???9?????°????????¶????????¨?????????
	Arrays.fill(numbers, 0); // 0??§?????????
	// ???????????°????????????????????????
	// ??????????????°????????????????????????????????????????????±??????????????????
	for (int i = 0; i < input.length; i++) {
	    // ???????????????????????????
	    int num = Integer.parseInt(input[i]);

	    for (int j = 0; j < 10; j++) {
		if (num == j) {
		    numbers[j] = i + 1;
		}
	    }
	}
	return numbers;
    }

    /**
     * ?????? ????????¨?§£????????¢???????????§?????????????????¨?????????????????????????´????????????????????????????
     * 
     * @param answer
     * @param expected
     * @return hitandblow?????????
     */
    public static int[] getHitAndBlow(int[] answer, int[] expected) {

	int[] hitAndBlow = new int[2]; // 0???hit 1???blow

	for (int i = 0; i < 10; i++) {
	    if (answer[i] == 0) {
		continue;
	    }
	    if (answer[i] == expected[i]) {
		hitAndBlow[HIT]++;
		continue;
	    }

	    if (answer[i] != 0 && expected[i] != 0) {
		hitAndBlow[BLOW]++;
		continue;
	    }
	}

	return hitAndBlow;
    }
}