while True:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
    except:
        break
    print(sum(x == y for x, y in zip(a, b)),  sum(a[i] != b[i] and a[i] in b for i in range(4)))