try:
    while True:
        #標準入力
        a_line = list(map(int,input().split()))
        b_line = list(map(int,input().split()))
        num1 = 0
        num2 = 0
        #場所も番号も同じならnum1数字が同じならnum2にいれる
        for num in range(0,4):
            if a_line[num] == b_line[num]:
                num1 += 1
                continue
            else:pass
            if a_line[num] in b_line:num2 += 1
            else:pass
        print(str(num1) + " " + str(num2))
#EOFErrorをひろう
except EOFError:
    pass
