using System;
class Program{
	static void Main(){
		string s;
		while((s = Console.ReadLine()) != null){
			int[] a = Array.ConvertAll(s.Split(' '), int.Parse);
			s = Console.ReadLine();
			int[] b = Array.ConvertAll(s.Split(' '), int.Parse);
			int hit = 0, blow = 0;
			for(int i = 0; i < 4; i++){
				for(int j = 0; j < 4; j++){
					if(a[i] == b[j]){
						if(i == j) hit++;
						else blow++;
						break;
					}
				}
			}
			Console.WriteLine(hit + " " + blow);
		}
	}
}