while True:
  try:
    alst = input().split()
    blst = input().split()

    hit = brow = 0

    for i in range(4):
      for j in range(4):
        if alst[i] == blst[j]:
          if i == j:
            hit += 1
          else:
            brow += 1

    print(hit, brow)

  except EOFError:
    break
