import java.util.*;

import static java.lang.System.*;

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

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    }
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long divide1 = (long) Math.sqrt(N); divide1 (long) Math.sqrt(N) Math.sqrt Math N while(N % divide1 != 0) {
            divide1--;
        } N % divide1 != 0 N % divide1 N divide1 0 {
            divide1--;
        } divide1-- divide1 long divide2 = N / divide1; divide2 N / divide1 N divide1 int len1 = String.valueOf(divide1).length(); len1 String.valueOf(divide1).length() String.valueOf(divide1).length String.valueOf(divide1) String.valueOf String divide1 int len2 = String.valueOf(divide2).length(); len2 String.valueOf(divide2).length() String.valueOf(divide2).length String.valueOf(divide2) String.valueOf String divide2 out.println(Math.max(len1, len2)) out.println out Math.max(len1, len2) Math.max Math len1 len2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    }
} Main
import java.util.*;

import static java.lang.System.*;

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

        // ルートN * ルートNのときが最も最小
        long divide1 = (long) Math.sqrt(N);

        while(N % divide1 != 0) {
            divide1--;
        }
        long divide2 = N / divide1;

        int len1 = String.valueOf(divide1).length();
        int len2 = String.valueOf(divide2).length();

        out.println(Math.max(len1, len2));
    }
}