n = gets.chomp.to_i
a = []
b = []
c = []
a.push(gets.chomp.split(" "))
b.push(gets.chomp.split(" "))
c.push(gets.chomp.split(" "))
x = 0
n.times do
	m=0
	if a[m]==b[m] && a[m]==c[m]
	elsif a[m]!=b[m] && a[m]!=c[m] && b[m]!=c[m]
		x+=2
	else
		x+=1
	end
	m+=1
end
puts x