while True:
    try:
        a=list(map(str,input().split()))
        b=list(map(str,input().split()))
    except EOFError:
        break
    c,d=0,0
    for i in range(4):
        if a[i]==b[i]:
            c+=1
        elif a[i] in b:
            d+=1
    print(c,d)
