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
m = 0
while m < n
	if a[m]==b[m]
		if a[m]!=c[m]
			x+=1
		end
	else
		if a[m]==c[m]
			x+=1
		elsif b[m]==c[m]
			x+=1
		else
			x+=2
		end
	end
m+=1
end
puts x