<?php

  // A?????????
  $stdin = trim(fgets(STDIN));  
  $aSan = explode(" ", $stdin);

  $bSanAr = Array();

  // B????????? ??¢???
  while($input = trim(fgets(STDIN))){
    if(empty($input)){
      break;
    }
    array_push($bSanAr, explode(" ", $stdin));
  }

  $hitCount = 0;
  $blowCount = 0;

  for($i=0; $i<count($bSanAr); $i++){
    for($j=0; $j<count($bSanAr[$i]); $j++){
      if($aSan[$j] == $bSanAr[$i][$j]){
        $hitCount++;
      }else if(in_array($bSanAr[$i][$j], $aSan)){
        $blowCount++;
      }
    }
  }

  echo $hitCount.' '.$blowCount;