package main import ( "strings" "fmt" "strconv" ) func main() { var input string result := []int{} fmt.Scan(&input) n, _ := strconv.Atoi(input) result = append(result, n) for i := 0; i < 100; i++ { x := strconv.Itoa(result[i]) y := strings.Split(x, "") var z int for _, a := range y { m, _ := strconv.Atoi(a) z += m } result = append(result, z) } fmt.Println(result[99]) }