#coding: utf-8

nMember=int(input())
nVotes=list(map(int,input().split()))
ntotal=sum(nVotes)
nBase=ntotal/10

nCnt=0

for i in range(nMember):
    if nVotes[i]<=nBase:
        nCnt+=1



nAns=30*nCnt

print (nAns)