#include <iostream>

#define SIZE 4

using namespace std;

int main() {
	int a[SIZE], b[SIZE], hit, blo;

	while (cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1]>>b[2]>>b[3]) {
		hit = 0;
		blo = 0;
		for (int i = 0; i < SIZE; i++) {
			if (a[i] == b[i]) {
				hit++;
				a[i] = 10 + hit;
				b[i] = 10 + hit;
			}
		}

		for (int i = 0; i < SIZE; i++) {
			for (int j = i + 1; j < SIZE; j++) {
				if (a[i] == 10 || b[j] == 10) {
					continue;
				}

				if (a[i] == b[j]) {
					a[i] = 10 + hit + blo;
					b[i] = 10 + hit + blo;
					blo++;
				}
			}
		}
		cout << hit << " " << blo << endl;
	}

	return 0;
}