N = int(input()) C = list(map(int, input().split())) S = sum(C)/10 ans = 0 for c in C: if c<=S: ans+=30 print(ans)