n = int(input()) c = list(map(int, input().split())) x = sum(c) / 10 print(len([i for i in c if i <= x]) * 30)