while True:
    try:
        a = [a for a in input().split()]
        b = [b for b in input().split()]
    except:
        break
    
    hit = 0
    blow = 0
    
    for i in range(4):
        if b[i] in a :
            blow += 1
            if b[i]==a[i]:
                hit += 1
    
    blow = blow-hit
    print(hit,blow)
