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