import strutils, sequtils, algorithm, math let n = readLine(stdin).parseInt cSeq = readLine(stdin).split(' ').map(parseInt) border = cSeq.sum div 10 var result = 0 for c in cSeq: if c <= border: result += 30 echo(result)