N = int(input()) C = list(map(int, input().split())) total = sum(C) print(sum([30 for v in C if v <= total / 10]))