while True:
   try:
      A = input().split()
      B = input().split()
      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
            else:
               pass
      print(h, b)
   except EOFError:
      break
