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

int main(){
  int a[4],b[4],i,j,hit=0,blow=0;



  for(i=0;i<4;i++){
    cin >> a[i] ;
  }
 for(i=0;i<4;i++){
   cin >> b[i] ;
 }
 
  for(i=0;i<4;i++){
    for(j=0;j<4;j++){
      if(a[i] == b[j] && i != j)blow++;
      if(a[i] == b[j] && i == j)hit++;
    }
  }

  cout << hit << " " << blow << endl;



}