n = int(input()) c = list(map(int, input().split())) judge = sum(c)/10 kyotaku = 0 for i in c: if i <= judge: kyotaku += 30 print(kyotaku)