while True:
    try:
        a = [x for x in input().split()]
        b = [x for x in input().split()]
        hit_count = 0
        blow_count = 0
        for i in range(4):
            if a[i] == b[i]:
                hit_count += 1
            elif(b[i] in a):
                blow_count += 1
        print(hit_count, blow_count)
    except EOFError:
        break

