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

object Main {
    def main(args: Array[String]): Unit = { 
        digit(readLine.split(" ").map(_.toInt).sum)
    }
    
    @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)
    }
}