a=[int(i) for i in input().split()]
while True:
 hit=0
 blow=0
 try:
  b=[int(i) for i in input().split()]
  blow=len(set(a)&set(b))
  for i,j for in zip(a,b):
   if i==j:
    hit+=1
  print(hit,blow-hit)     
 except EOFError:
  break