def main():
    while True:
        try:
            A = list(map(int,input().split()))
            B = list(map(int,input().split()))
            hit_count = 0
            blow_count = 0
            for i in range(4):
                for j in range(4):
                    if A[i] == B[i]:
                        hit_count += 1
                        break
                    if A[i] == B[j]:
                        blow_count += 1
                        break
            print(str(hit_count)+ " " + str(blow_count))
        except EOFError:
            break




if __name__ == '__main__':
    main()

