N=int(input()) C=list(map(int,input().split())) standard=sum(C)/10 print(len([i for i in C if i<=standard])*30)