#!/usr/bin/env python3
#fileencoding: utf-8

N = int(input())
C = [int(i) for i in input().strip().split(" ")]
total = sum(C)
print(sum([1 for i in C if total >= i*10]) * 30)