import java.util.Scanner;

public class Main {

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

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

        System.out.println(ans);
    }

    private static int f(final int a, final int b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

        System.out.println(ans);
    }

    private static int f(final int a, final int b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

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

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

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

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

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

        System.out.println(ans);
    }

    private static int f(final int a, final int b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
} public class Main {

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

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

        System.out.println(ans);
    }

    private static int f(final int a, final int b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
} Main
import java.util.Scanner;

public class Main {

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

        final long N = sc.nextLong();

        long ans = Long.MAX_VALUE;

        for (int i = 1; i <= Math.sqrt(N); i++) {
            if ((i*(N/i)) == N) {
                ans = Math.min(ans, f(i, (int) (N/i)));
            }
        }

        System.out.println(ans);
    }

    private static int f(final int a, final int b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
}
