import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;

void main()
{
    for(string s; (s=readln().chomp()).length; )
    {
        immutable N=4;
        auto a = s.split().map!(to!int).array();
        auto b = readln().split().map!(to!int).array();
        int h=0,m=0;
        foreach(i;0..N)
            if(a[i]==b[i]) ++h;
            else
                foreach(j;0..N)
                    if(a[i]==b[j]) ++m;
        writeln(h," ",m);
    }
}