#include <stdio.h>
#include <algorithm>
#include <iostream>
using namespace std;

#define REP(i,n) for(int i=0; i<n; i++)

int main()
{
  int a[4], b[4];
  while(cin >> a[0]){
    REP(i,3) cin >> a[i+1];
    REP(i,4) cin >> b[i];

    int hit=0, blow=0;
    REP(i,4){
      if(a[i]==b[i])
	hit++;
      else{
	REP(j,4){
	  if(a[i]==b[j])
	    blow++;
	}
      }
    }

    cout << hit << " " << blow << endl;
  }
  return 0;
}