n = int(input()) c = list(map(int,input().split(" "))) k = 0 for i in range(n): if sum(c) == 0: k = k + 30 elif c[i]/sum(c) <= 0.1: k = k + 30 print(k)