xx = gets()
yy = gets()
while xx 
x = xx.split()
y = yy.split()
a1 = x[0].to_i
a2 = x[1].to_i
a3 = x[2].to_i
a4 = x[3].to_i
b1 = y[0].to_i
b2 = y[1].to_i
b3 = y[2].to_i
b4 = y[3].to_i
s = [a1,a2,a3,a4]
t = [b1,b2,b3,b4]

h = 0
f = 0
 
i = 0
while i < 4
 if s[i] == t[i]
  h += 1
 elsif s.include?(t[i])
  f += 1
 end
 i += 1
end

puts "#{h} #{f}"
xx = gets()
yy = gets()
end
