a = []
b = []
c = []
n = gets.chomp.to_i
n -=1
a.push(gets.chomp.split(" "))
b.push(gets.chomp.split(" "))
c.push(gets.chomp.split(" "))
x = 0
while n>=0
	if a[n]!=b[n]
		if a[n]==c[n]
			x=x+1
		else
			if b[n]==c[n]
				x=x+1
			else
				x=x+2
			end
		end
	else
		if b[n]!=c[n]
			x=x+1
		end
	end
	n-=1
end
puts x