while(1):
    try:
        alist = list(map(int, input().split()))
        blist = list(map(int, input().split()))
    except:
        break
 
    hit = 0
    blow = 0
 
    for i in range(4):
        for j in range(4):
            if alist[i] == blist[j]:
                if i == j:
                    hit += 1
                else:
                    blow += 1
 
    print(hit, blow)
