import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    }

    private static long F(String a, String b) {
        return Math.max(a.length(), b.length());
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    }

    private static long F(String a, String b) {
        return Math.max(a.length(), b.length());
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    } try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        } {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) long N = in.nextLong(); N in.nextLong() in.nextLong in long min = (long) 1e18; min (long) 1e18 long sqrt = (long) Math.sqrt(N) + 10; sqrt (long) Math.sqrt(N) + 10 (long) Math.sqrt(N) Math.sqrt Math N 10 for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            } long A = 1; long A = 1; A 1 A < sqrt A sqrt A++ A++ A {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            } {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            } if (N % A != 0) {
                    continue;
                } N % A != 0 N % A N A 0 {
                    continue;
                } continue; long B = N / A; B N / A N A min = Math.min(min, F("" + A, "" + B)) min Math.min(min, F("" + A, "" + B)) Math.min Math min F("" + A, "" + B) F "" + A "" A "" + B "" B System.out.println(min) System.out.println System.out System System.out min String[] args args private static long F(String a, String b) {
        return Math.max(a.length(), b.length());
    } F {
        return Math.max(a.length(), b.length());
    } return Math.max(a.length(), b.length()); Math.max(a.length(), b.length()) Math.max Math a.length() a.length a b.length() b.length b String a a String b b public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    }

    private static long F(String a, String b) {
        return Math.max(a.length(), b.length());
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    }

    private static long F(String a, String b) {
        return Math.max(a.length(), b.length());
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            long N = in.nextLong();

            long min = (long) 1e18;
            long sqrt = (long) Math.sqrt(N) + 10;
            for (long A = 1; A < sqrt; A++) {
                if (N % A != 0) {
                    continue;
                }
                long B = N / A;

                min = Math.min(min, F("" + A, "" + B));
            }

            System.out.println(min);
        }
    }

    private static long F(String a, String b) {
        return Math.max(a.length(), b.length());
    }
}
