N = int(input()) l = list(map(int, input().split())) c = 0 for x in l: if x<=sum(l)/10: c += 30 print(c)