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