
while True:
  try:
    a_list = map(int, raw_input().strip().split(" "));
    b_list = map(int, raw_input().strip().split(" "));
  except:
    break;
  hit, blow = 0, 0
  for a, b in zip(a_list, b_list):
    if (a == b):
      hit += 1;
    elif(a in b_list):
      blow += 1;
  print hit, blow