import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        } int i = 1; int i = 1; i 1 i <= Math.sqrt(N) i Math.sqrt(N) Math.sqrt Math N i++ i++ i {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        } {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        } if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            } N % i == 0 N % i N i 0 {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            } int a = String.valueOf(i).length(); a String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i int b = String.valueOf(N / i).length(); b String.valueOf(N / i).length() String.valueOf(N / i).length String.valueOf(N / i) String.valueOf String N / i N i ans = Math.min(Math.max(a,b), ans) ans Math.min(Math.max(a,b), ans) Math.min Math Math.max(a,b) Math.max Math a b ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (int i = 1; i <= Math.sqrt(N); i++) {
            if (N % i == 0) {
                int a = String.valueOf(i).length();
                int b = String.valueOf(N / i).length();
                ans = Math.min(Math.max(a,b), ans);
            }
        }

        System.out.println(ans);
    }
}
