import sys

while True:
  a = sys.stdin.readline()
  if not a: break

  a = a.rstrip().split(" ")
  b = raw_input().rstrip().split(" ")

  hit=0
  for i in range(len(a)):
    if a[i] == b[i]:
      hit+=1
      a[i] = -1

  blow=0
  for e in b:
    if e in a:
      blow+=1

  print("{} {}").format(hit, blow)