# coding: utf-8
# Your code here!

while True:
   try:
      A = list(input())
      B = list(input())
      
      for i in range(A.count(' ')):
         A.remove(' ')
      for i in range(B.count(' ')):
         B.remove(' ')
      #print(A, B)
      
      h = 0 #ブロー数
      b = 0 #ヒット数
      for i in range(4):
         for j in range(4):
            if A[i] == B[j]:
               if i == j:
                  h += 1
               else:
                  b += 1
      print(h, b)

   except EOFError:
      break

