<?php
function solve() {
    $a = explode(' ', trim(fgets(STDIN)));
    $b = explode(' ', trim(fgets(STDIN)));
    $hit = 0;
    $blow = 0;
    foreach ($a as $ka => $va) {
        foreach ($b as $kb => $vb) {
            if ($va != $vb) continue;
            if ($ka == $kb) $hit++;
            if ($ka != $kb) $blow++;
        }
    }
    
    echo $hit.' '.$blow.PHP_EOL;
}

while (!feof(STDIN)) {
    solve();
}

