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

void main() {
    string str;
    while((str = readln()).length != 0) {
        int[] ax = map!(to!int)(str.chomp.split).array;
        int[] bx = map!(to!int)(readln().chomp.split).array;
        int intersect_num = 0;
        foreach(a ; ax) {
            foreach(b ; bx) {
                if (a == b) { ++intersect_num; }   
            }
        }
        int hit = 0;
        for (uint i = 0; i < 4; ++i) {
            if (ax[i] == bx[i]) { ++hit; }
        }
        int blow = intersect_num - hit;
        writef("%d %d\n", hit, blow);
    }
}