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

void main()
{
	foreach (line; stdin.byLine) {
		auto a = line.split.map!(to!int);
		auto b = readln.split.map!(to!int);
		int[10] al, bl;
		int hit;
		foreach (i; 0..4) {
			al[a[i]]++;
			bl[b[i]]++;
			if (a[i] == b[i]) hit++;
		}
		int blow;
		foreach (i; 0..10) {
			blow += min(al[i], bl[i]);
		}
		writeln(hit, " ", blow-hit);
	}
}