while True:
    try:
        a = map(int, raw_input().split())
        b = map(int, raw_input().split())
        hit,blow = 0,0
        for i in range(4):
            if a[i] == b[i]:
                hit += 1
            else:
                for j in range(4):
                    if a[i] == b[j]:
                        blow += 1
        print hit, blow
    except EOFError:
        break