while True:
  try:
    hit=0
    brow=0
    a = map(int,raw_input().split())
    a1,b1,c1,d1 = a[0],a[1],a[2],a[3]
    b = map(int,raw_input().split())
    a2,b2,c2,d2 = b[0],b[1],b[2],b[3]
    for c in range(4):
      if a[c] == b[c]: hit +=1
      for d in range(4):
        if a[c]==b[d]:
          if c == d:
            break
          brow += 1

    print hit,brow
  except EOFError:
    break