import java.util.Scanner;

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

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    }
} 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();

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long ans = Long.MAX_VALUE; ans Long.MAX_VALUE Long Long.MAX_VALUE for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        } long i=1; long i=1; i 1 i*i<=n i*i i i n i++ i++ i {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        } {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        } if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            } n % i == 0 n % i n i 0 {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            } long digitsA = String.valueOf(i).length(); digitsA String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i long digitsB = String.valueOf(n/i).length(); digitsB String.valueOf(n/i).length() String.valueOf(n/i).length String.valueOf(n/i) String.valueOf String n/i n i ans = Math.min(Math.max(digitsA,digitsB),ans) ans Math.min(Math.max(digitsA,digitsB),ans) Math.min Math Math.max(digitsA,digitsB) Math.max Math digitsA digitsB ans 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 sc = new Scanner(System.in);
        long n = sc.nextLong();

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

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

        long ans = Long.MAX_VALUE;
        for(long i=1; i*i<=n; i++) {
            if(n % i == 0) {
                long digitsA = String.valueOf(i).length();
                long digitsB = String.valueOf(n/i).length();
                ans = Math.min(Math.max(digitsA,digitsB),ans);
            }
        }
        System.out.println(ans);
    }
}
