while True:
  try:
    a_set = list(map(int, input().split()))
    b_set = list(map(int, input().split()))
  except EOFError:
    break
  hit = 0
  blow = 0
  for i in range(4):
    if a_set[i] == b_set[i]:
      hit += 1
  for i in range(4):
    for j in range(4):
      if a_set[i] == b_set[j] and i != j:
        blow += 1
  print(hit,blow)
