n = gets.to_i
word = []
while line = gets
  line.chomp! 
  word.push(line)
end
count = []
ww = []
x = 0
while x < n do
    i = 0
    while i < 3 do
        count.push(word[i][x])
        i += 1
    end
    ww.push(3 - count.count(count.group_by(&:itself).max_by{|_,v| v.size}.first))
    count = []
    x += 1
end
puts ww.inject(:+)