<?php
while($input = fgets(STDIN)){
$arr1 = explode(' ', trim($input));
$arr2 = explode(' ', trim(STDIN));
 
$h = 0;
for($i=0;$i<4;++$i){
 if($arr1[$i] == $arr2[$i]){
  ++$h;
 }
}
$b = count(array_intersect($arr1,$arr2));
echo $h.' '.$b.'\n';
 
}