#include <stdio.h>

int main(void){
  int a[4];
  int b[4];
  int i;
  int h,b;
   while( scanf("%d",&a[0]) != EOF){
    h=0; b=0;
   for(i=1; i<4; i++){
     scanf("%d",&a[i]);
}
   for(i=0; i<4; i++){
     scanf("%d",&b[i]);
}
    for(i=0;i<4;i++){
       if(a[i] == b[i])
           h++;
       if(a[i] == b[(i+1)%4]||a[i] == b[(i+2)%4]||a[i] == b[(i+3)%4]) 
           b++;
     }
     printf("%d %d\n",h,b);
}
     return 0;
}