a=[]
b=[]
while  n=gets
  a = n.split(" ").map(&:to_i)
  m=gets
  b = m.split(" ").map(&:to_i)
  j=0
  k=0
  4.times{|i|
    j+=1 if a[i]==b[i]
    k+=1 if a.include?(b[i])
  }
  puts print("#{j} #{k-j}")
end
