package main import ( "fmt" "math" ) func main() { var n, sum, ans int fmt.Scan(&n) c := make([]int, n) for i := 0; i < n; i++ { var tmp int fmt.Scan(&tmp) c[i] = tmp sum += tmp } b := int(math.Ceil(float64(sum) / 10.0)) for i := 0; i < n; i++ { if c[i] <= b { ans += 30 } } fmt.Println(ans) }