import java.util.Scanner object Problem191 { def proc(c: Seq[Int]): Int = { val totalVote: Int = c.sum // totalVoteの方を10で割ると丸められて面倒 c.count(_ * 10 <= totalVote) * 30 } def main(args: Array[String]) { val sc = new Scanner(System.in) val n = sc.nextInt() val c = Seq.fill(n)(sc.nextInt()) val result:Int = proc(c) println(result) } }