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