import std.stdio;
import std.string;
import std.math;
import std.conv;
import std.algorithm;
import std.bigint;

void main(){

    while(true){
	auto s = split(readln());
	if(stdin.eof()) break;
	int[] a, b;
	foreach(i ; s) a ~= to!int(i);
	s = split(readln());
	foreach(i ; s) b ~= to!int(i);
	int hit = 0, blow = 0;
	for(int i=0;i<4;i++){
	    if(a[i] == b[i] ) hit++;
	    for(int j=0;j<4;j++){
		if(a[i] == b[j] && i != j) blow++;
	    }
	}
	writef("%d %d\n",hit,blow);
    }
}