#include <algorithm>
using namespace std;

int a[4],b[4];
int main(){
  int i,j,m,n,x;
  for(;~scanf("%d%d%d%d%d%d%d%d",a,a+1,a+2,a+3,b,b+1,b+2,b+3);printf("%d %d\n",x,m-x)){
    for(m=x=i=j=0;i<4;i++)if(a[i]==b[i])x++;
    for(;j++<24;next_permutation(b,b+5),m=n>m?n:m)for(n=i=0;i<4;i++)if(a[i]==b[i])n++;
  }
}