def judge_hit(num1, num2):
    cnt = 0
    for a, b in zip(num1, num2):
        if a == b:
            cnt += 1
    return cnt

def judge_blow(num1, num2, hit):
    cnt = 0
    for b in num2:
        cnt += (b in num1)
    return cnt - hit

while True:
    try:
        A_number = map(int, raw_input().split())
        B_number = map(int, raw_input().split())
        hit = judge_hit(A_number, B_number)
        blow = judge_blow(A_number, B_number, hit)
        print hit, blow 
    except:
        break
