while True:

  a = map(int, raw_input().split())
  b = map(int, raw_input().split())

  hit = 0
  blow = 0

  for i in range(4):

    if(a[i] == b[i]):
      hit += 1

    elif(a[i] in b):
      blow += 1

  print hit, blow