n=input() c=map(int,raw_input().split()) y=sum(c)/10 print sum(30 for i in c if i<=y)