while p1=gets do
  hit,blow=0,0
  p2=gets.split(" ").to_enum
  p1=p1.split(" ").to_enum
  loop{
    b1,b2=p1.next,p2.next
    hit+=1 if b1==b2
    blow+=1 unless p1.find{|n|n==b2}
  }
  blow-=1
  print "%d %d\n" % [hit,blow]
end