#include<iostream>
using namespace std;
int a[4],b[4],hit=0,blow=0;
int main(){while(cin>>a[1]>>a[2]>>a[3]>>a[0]>>b[1]>>b[2]>>b[3]>>b[0]){for(int i=0;i<4;i++){for(int ii=0;ii<4;ii++){if(a[i]==b[ii]){if(i==ii){hit++;}else{blow++;}}}}cout<<hit<<" "<<blow<<endl;hit=0;blow=0;}return 0;}
