while True:
  try:
    a = map(int, raw_input().split())
    b = map(int, raw_input().split())
  except:
    break
  ab = zip(a, b)
  hit = 0
  blow = 0
  for xa, xb in ab:
    if xa == xb:
      hit  += 1
    elif xa in b:
      blow += 1
  print('%d %d' % (hit, blow))