while True:
    try:
        hit = 0
        blow = 0
        hit_idx = []
        s = list(map(int, input().split()))
        t = list(map(int, input().split()))
        for i in range(4):
            if s[i] == t[i]:
                hit_idx.append(i) 
        hit = len(hit_idx)                                
        for i in hit_idx[::-1]:     # reverse order
            s = s[:i] + s[(i+1):]
            t = t[:i] + t[(i+1):]
        for c in s:
            if c in t:
                blow += 1
                                
        print("%d %d" % (hit,blow)) 
    except:
        break