n = gets.chomp.to_i
ary = []
3.times do
    ary << gets.chomp
end

count = 0
n.times do |i|
    tmp = []
    3.times do |j|
        tmp << ary[j][i]
    end
    tmp.uniq!
    count += tmp.length - 1
end
puts count