# coding=utf-8: n = int(input()) c = list(map(int, input().split())) c_total = 0 for i in c: c_total += i count = 0 for i in range(len(c)): if c[i] > c_total * 0.1: continue else: count += 1 print(count * 30)