n = int(input()) c = list(map(int,inout().split())) print(sum([[30,0][x>sum(c)/10] for x in c]))