#!/usr/bin/env python

from fractions import gcd

def main():

    N = int(eval(input()))

    ans = len(str(N))

    for i in range(len(str(N)) // 2 + 1):

            for j in reversed(list(range(10**i, 10**(i+1)))):

                if N % j == 0:

                    tmp = max(len(str(j)), len(str(N // j)))

                    if ans > tmp:

                        ans = tmp

                    break

    print(ans)



if __name__ == '__main__':

    main()
#!/usr/bin/env python

import math

def main():

    N = int(eval(input()))

    ans = len(str(N))

    for i in range(1, math.ceil(math.sqrt(N))+1):

        if N % i == 0:

            tmp = max(len(str(i)), len(str(N // i)))

            if ans > tmp:

                ans = tmp

    print(ans)



if __name__ == '__main__':

    main()
#!/usr/bin/env python
from fractions import gcd


def main():
    N = int(eval(input()))
    ans = len(str(N))
    for i in range(len(str(N)) // 2 + 1):
        for j in reversed(list(range(10**i, 10 ** (i + 1)))):
            if N % j == 0:
                tmp = max(len(str(j)), len(str(N // j)))
                if ans > tmp:
                    ans = tmp
                break
    print(ans)


if __name__ == "__main__":
    main()

#!/usr/bin/env python
import math


def main():
    N = int(eval(input()))
    ans = len(str(N))
    for i in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % i == 0:
            tmp = max(len(str(i)), len(str(N // i)))
            if ans > tmp:
                ans = tmp
    print(ans)


if __name__ == "__main__":
    main()

-from fractions import gcd +import math -    for i in range(len(str(N)) // 2 + 1): -        for j in reversed(list(range(10**i, 10 ** (i + 1)))): -            if N % j == 0: -                tmp = max(len(str(j)), len(str(N // j))) -                if ans > tmp: -                    ans = tmp -                break +    for i in range(1, math.ceil(math.sqrt(N)) + 1): +        if N % i == 0: +            tmp = max(len(str(i)), len(str(N // i))) +            if ans > tmp: +                ans = tmp