import sys

even = True
for s in sys.stdin:
    if even:
        even = False
        a = list(map(int, s.split()))
    else:
        even = True
        b = list(map(int, s.split()))
        hit = sum(a[i] == b[i] for i in range(4))
        blow = sum(b[i] in a for i in range(4)) - hit
        print(hit, blow)