'use strict';

var input = require('fs').readFileSync('/dev/stdin', 'utf8'); // import 'fs' module, using readFileSync()
var lines = input.split('\n');
while (lines.length !== 0) {
	var A = lines.shift().split(' ');
	var B = lines.shift().split(' ');
	var hit = 0;
	var blow = 0;
	for (var i = 0; i < B.length; ++i) {
		if (B[i] === A[i]) {
			hit += 1;
		} else {
			for (var j = 0; j < A.length; ++j) {
				if (B[i] === A[j]) {
					blow += 1;
					break;
				}
			}
		}
	}
	console.log('%d %d', hit, blow);
}