package main import "fmt" func main() { var n string fmt.Scan(&n) str := "1" i := 0 for ; len(n) != len(str); i++ { str += "3" } if n != str || i == 0 { i = -1 } fmt.Println(i) }