<?php
while($input = fgets(STDIN)){
$arr1 = explode(" ", trim($input));
     
$input = fgets(STDIN);
$arr2 = explode(" ", trim($input));

$h = 0;
for($i=0;$i<4;++$i){
 if($arr1[$i] == $arr2[$i]){
  ++$h;
 }
}
$b = count(array_intersect($arr1,$arr2));
echo "{$hit} {$brow}\n";
  
}