package main import . "fmt" func main() { var n,c int64 Scan(&n) for i:=1;;i++ { s:=Sprint(i) s+=s+s Sscan(s,&c) if c>n { Println(i-1) return } } }