import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    }

    private static int solve(long N) {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    }

    private static int F(long a, long 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) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    }

    private static int solve(long N) {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    }

    private static int F(long a, long b) {
        return Math.max( String.valueOf(a).length(), String.valueOf(b).length() );
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc System.out.println( solve(N) ) System.out.println System.out System System.out solve(N) solve N String[] args args private static int solve(long N) {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    } solve {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    } int max = (int)Math.ceil(Math.sqrt(N)); max (int)Math.ceil(Math.sqrt(N)) Math.ceil Math Math.sqrt(N) Math.sqrt Math N int min = 10; min 10 for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        } int i = 1; int i = 1; i 1 i <= max i max i++ i++ i {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        } {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        } if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            } N % i == 0 N % i N i 0 {
                min = Math.min(F(i, N/i), min);
            } min = Math.min(F(i, N/i), min) min Math.min(F(i, N/i), min) Math.min Math F(i, N/i) F i N/i N i min return min; min long N N private static int F(long a, long 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 long a a long b b public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    }

    private static int solve(long N) {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    }

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    }

    private static int solve(long N) {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    }

    private static int F(long a, long 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) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println( solve(N) );
    }

    private static int solve(long N) {
        // Nがさほど大きくないので sqrt(N)の範囲で因数を探し
        // F(factor, N/factor)してminを探す
        int max = (int)Math.ceil(Math.sqrt(N));

        // 2/maxにできるだろうけど面倒くさいしいいよね...
        int min = 10;
        for (int i = 1; i <= max; i++) {
            if( N % i == 0 ) {
                min = Math.min(F(i, N/i), min);
            }
        }
        return min;
    }

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