while True:
 l1=list(map(int,input().split()))
 l2=list(map(int,input().split()))
 hit=blow=0
 for i in l1:
   for s in l2:
    if i==s:
     if l1.index(i)==l2.index(s):
       hit+=1
     else:
       blow+=1
 print(hit,blow)
        
    