n = input() v = list(map(int, input().split())) t = 0 for i in v: t += i r = 0 for i in v: if i == 0: r += 30 elif i/t <= 0.1: r += 30 print(r)