n = gets.to_i num = [] n.times do |i| num[i] = gets.count("^") end print num.sort{|x,y| num.count(y) <=> num.count(x) }[0]