while True:
    try:
        a = list(map(int, input().split()))
        b = list(map(int, input().split()))
    except:
        break
    hit = 0
    blow = 0
    for i, n in enumerate(a):
        if b[i] == n:
            hit += 1
        elif n in b:
            blow += 1
    print(hit, blow)