import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    }

    static long func(long n) {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    }

    static long func(long n) {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc int sqrN = (int)Math.sqrt(n); sqrN (int)Math.sqrt(n) Math.sqrt Math n long res = Integer.MAX_VALUE; res Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        } int i = 1; int i = 1; i 1 i <= sqrN i sqrN ++i ++i i {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        } {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        } if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            } n % i == 0 n % i n i 0 {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            } long b = n / i; b n / i n i long tmp = Math.max(func(i), func(b)); tmp Math.max(func(i), func(b)) Math.max Math func(i) func i func(b) func b if (tmp < res) res = tmp; tmp < res tmp res res = tmp res tmp System.out.println(res) System.out.println System.out System System.out res String[] args args static long func(long n) {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    } func {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    } long cnt = 0; cnt 0 while (n != 0) {
            n /= 10;
            ++cnt;
        } n != 0 n 0 {
            n /= 10;
            ++cnt;
        } n /= 10 n 10 ++cnt cnt return cnt; cnt long n n public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    }

    static long func(long n) {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    }

    static long func(long n) {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int sqrN = (int)Math.sqrt(n);

        long res = Integer.MAX_VALUE;
        for (int i = 1; i <= sqrN; ++i) {
            if (n % i == 0) {
                long b = n / i;

                long tmp = Math.max(func(i), func(b));
                if (tmp < res) res = tmp;
            }
        }

        System.out.println(res);
    }

    static long func(long n) {
        long cnt = 0;
        while (n != 0) {
            n /= 10;
            ++cnt;
        }
        return cnt;
    }
}
