import java.util.Scanner;
public class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    }
} Main public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    } main {
        Scanner scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = 0; N 0 int ans = (int) 1e9; ans (int) 1e9 N = scanner.nextLong() N scanner.nextLong() scanner.nextLong scanner long A = 1; A 1 long B = 1; B 1 for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        } A = 1; A = 1 A 1 A <= Math.sqrt(N) A Math.sqrt(N) Math.sqrt Math N A++ A++ A {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        } {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        } B = N / A B N / A N A if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            } A * B == N A * B A B N {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            } ans = Math.min(ans, String.valueOf(Math.max(A, B)).length()) ans Math.min(ans, String.valueOf(Math.max(A, B)).length()) Math.min Math ans String.valueOf(Math.max(A, B)).length() String.valueOf(Math.max(A, B)).length String.valueOf(Math.max(A, B)) String.valueOf String Math.max(A, B) Math.max Math A B 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 scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        long N = 0;
        int ans = (int) 1e9;
        N = scanner.nextLong();
        long A = 1;
        long B = 1;
        for (A = 1; A <= Math.sqrt(N); A++) {
            B = N / A;
            if (A * B == N) {
                ans = Math.min(ans, String.valueOf(Math.max(A, B)).length());
            }

        }
        System.out.println(ans);
    }
}
