import java.util.*;
import java.io.*;

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    }

    public static long f(long a, long b) {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    }

    public static long f(long a, long b) {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long min = 1000000000; min 1000000000 for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        } long i = 1; long i = 1; i 1 i <= (long)Math.sqrt(n) i (long)Math.sqrt(n) Math.sqrt Math n i++ i++ i {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        } {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        } if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            } n % i == 0 n % i n i 0 {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            } long a = i; a i long b = n / i; b n / i n i min = Math.min(min, f(a,b)) min Math.min(min, f(a,b)) Math.min Math min f(a,b) f a b System.out.println(min) System.out.println System.out System System.out min String[] args args public static long f(long a, long b) {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    } f {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    } long num = Math.max(a,b); num Math.max(a,b) Math.max Math a b long digits = 0; digits 0 while (num > 0) {
            num /= 10;
            digits++;
        } num > 0 num 0 {
            num /= 10;
            digits++;
        } num /= 10 num 10 digits++ digits return digits; digits 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();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    }

    public static long f(long a, long b) {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    }
} public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    }

    public static long f(long a, long b) {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long min = 1000000000;
        for (long i = 1; i <= (long)Math.sqrt(n); i++) {
            if (n % i == 0) {
                long a = i;
                long b = n / i;
                min = Math.min(min, f(a,b));
            }
        }
        System.out.println(min);
    }

    public static long f(long a, long b) {
        long num = Math.max(a,b);
        long digits = 0;
        while (num > 0) {
            num /= 10;
            digits++;
        }
        return digits;
    }
}