while 1:
   try:
       h = 0
       b = 0
       que=input().split(" ")
       ans=input().split(" ")
       for i in range(4):
             for j in range(4):
                    if que[i] == ans[j] and i != j:
                         b = b + 1
                    if que[i] == ans[j] and i == j:
                         h = h + 1
       print(str(h) + " " + str(b))
   except:break
