import sys
for line in sys.stdin:
    hit = 0
    blow = 0
    a_nums = line.split()
    for i_b, b in input().split():
        try:
            i = a_nums.index(b)
            if i == i_b:
                hit += 1
            else:
                blow += 1
        except ValueError:
            continue
    print(hit, blow)