import scala.io.StdIn._
import scala.annotation.tailrec

object Main {
    def main(args: Array[String]): Unit = { 
        @tailrec
        def digit(n: Int): Unit = {
           println(n.toString.length)
           val next: String = readLine
           if(next == null) Unit else digit(next.split(" ").map(_.toInt).sum)
        }
        digit(readLine.split(" ").map(_.toInt).sum)
    }   
}