#include <iostream>
#include <algorithm>
using namespace std;

int main() {
  int a[4], b[4];

  while(cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3]) {
    int hit=0, blow=0;
    bool checked[4][4]; for(int i=0;i<4;i++)for(int j=0;j<4;j++)checked[i][j]=false;
    
    for(int i = 0; i < 4; i++) {
      for(int j = 0; j < 4; j++) {
	if(checked[i][j]) continue;
	
	if(i == j && a[i] == b[j]) {
	  hit++;
	  checked[i][j] = true; checked[j][i] = true;
	}
	else if(a[i] == b[j]) {
	  blow++;
	  checked[i][j] = true; checked[j][i] = true;
	}
      }
    }

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