input() a = list(map(int, input().split())) gou = sum(a) / 10 print(len(list(filter(lambda x: x <= gou, a))) * 30)