n = int(input()) a = list(map(int, input().split())) sum = sum(a) ans =0 for i in range(n): if a[i]/sum <= 1/10: ans+=30 print(ans)