while True:
    try:
        Hflag,Bflag=0,0
        a = map(int,raw_input().split())
        b = map(int,raw_input().split())
        for i in range(4):
            if a[i] == b[i]:
                Hflag += 1
            else:
                continue
        for j in range(4):
            for k in range(4):
                if a[j] == b[k]:
                    Bflag += 1
                else:
                    continue
        Bflag = Bflag - Hflag
        print Hflag, Bflag
    except:
        break
