import Foundation

//素数判定する関数 ex:) primeJudge(32) -> true
func primeJudge(_ num: Int) -> Bool {
    var i = 2
    if num == 1 {
        return false
    }
    if num == 2 || num == 3{
        return true
    }
    
    for i in 2 ... Int(sqrt(Double(num))) {
        if num%i == 0 {
            return false
        }
    }
    return true
}

//約数列挙する関数 ex:) multiple(32) -> [1,2,4,8,16,32]
func factors(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    for i in 1 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            factorsArr.append(i)
            if num/i != i {
            factorsArr.append(num/i)
            }
        }
    }
    
    return factorsArr.sorted()
}
//指数を求める ex:) exponents(32,2) -> 5
func exponents(_ num1: Int, _ num2: Int) -> Int {
    if num2 == 1 {
        return 1
    }
    var count = 0
    var num1 = num1
    while num1.isMultiple(of: num2) {
        num1 /= num2
        count += 1
    }
    return count
}


//素因数分解1 役数と指数を連続で格納
func primeFactorization1(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
            factorsArr.append(i)
            factorsArr.append(exponents(num, i))
            }
        }
    }
    print(factorsArr)
    return factorsArr.sorted()
}

//素因数分解2 役数と指数を別の配列に格納
func primeFactorization2(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    var exponentsArr = [Int]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
            factorsArr.append(i)
            exponentsArr.append(exponents(num, i))
            }
        }
    }
    print(factorsArr)
    print(exponentsArr)
    return factorsArr.sorted()
}
//素因数分解3 役数と指数を二次元配列に格納
func primeFactorization3(_ num: Int) -> [[Int]] {
    var primeFactArr = [[Int]]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
                primeFactArr.append([i,exponents(num, i)])
            }
        }
    }
    return primeFactArr
}
primeFactorization3(150)
//桁数を返す関数
func numberOfDigits(_ num: Int) -> Int {
    var digits = 1
    var num = num
    while num >= 10 {
        num /= 10
        digits += 1
    }
    return digits
}


let rdInt = Int(readLine()!)!


func factors1(_ num: Int) -> Int {
    var factorsArr = [Int]()
    for i in 1 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            factorsArr.append(max(numberOfDigits(i),numberOfDigits(num/i)))
        }
    }
    
    return factorsArr.min()!
}

print(factors1(rdInt))