package main import ( "bufio" "fmt" "io" "log" "os" "strconv" "strings" ) func Run(in io.Reader, out io.Writer) error { sc := bufio.NewScanner(in) for sc.Scan() { var sum int64 = 0 line := sc.Text() for _, scoreText := range strings.Split(line, "") { score, err := strconv.ParseInt(scoreText, 0, 64) if err != nil { log.Fatal(err) } if score == 0 { sum += 10 } else { sum += score } } fmt.Fprintf(out, "%d\n", sum) return nil } return nil } func main() { err := Run(os.Stdin, os.Stdout) if err != nil { log.Fatal(err) } }