# -*- coding: utf-8 -*-

import sys

lines = sys.stdin.readlines()
for i in range(len(lines)/2):
    line1 = lines[2*i]
    line2 = lines[2*i+1]
    hit = blow = 0
    A = map(int, line1.split())
    B = map(int, line2.split())
    for i in range(4):
        if A[i] == B[i]:
            hit += 1
    for i in range(4):
        for j in range(4):
            if A[i] == B[j]:
                blow += 1
                break
    blow -= hit
    print "%d %d" %(hit, blow)