input() c=[int(x) for x in input().split()] f=0 for m in c: if m<=(sum(c)/10): f+=30 print(f)