package main import ( "fmt" "strings" ) func main() { var n string fmt.Scan(&n) ok := true if n[0] == '1' && len(n) > 1 { if strings.ContainsAny(n[1:], "012456789") { ok = false } } else { ok = false } if ok { fmt.Println(len(n) - 1) } else { fmt.Println(-1) } }