<?php
while(($input = trim(fgets(STDIN))) != ''){
$arr1 = explode(' ', $input);
$arr2 = explode(' ', 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';
 
}