while True:
  try:
    hit=0
    blow =0
    a,b = raw_input(),raw_input()
    for x in range(0,7,2):
      for y in range(0,7,2):
        if a[x] == b[y]:
          if x == y: hit+=1
          else: blow +=1
    print hit,blow
  except EOFError:
      break