N = gets.to_i C = gets.split.map(&:to_i) S = C.sum puts 30 * C.count{|n| n * 10 <= S }