import java.util.*;
 
 
class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long min = Integer.MAX_VALUE;

        for(long a=1; a<=Math.sqrt((double)N);a++){
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        }
        System.out.println(min);

    }
} import java.util.*; util.* java class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long min = Integer.MAX_VALUE;

        for(long a=1; a<=Math.sqrt((double)N);a++){
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        }
        System.out.println(min);

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

        for(long a=1; a<=Math.sqrt((double)N);a++){
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        }
        System.out.println(min);

    } main {
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long min = Integer.MAX_VALUE;

        for(long a=1; a<=Math.sqrt((double)N);a++){
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        }
        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 = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(long a=1; a<=Math.sqrt((double)N);a++){
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        } long a=1; long a=1; a 1 a<=Math.sqrt((double)N) a Math.sqrt((double)N) Math.sqrt Math (double)N a++ a++ a {
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        } {
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        } if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            } N%a==0 N%a N a 0 {
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            } long b = N/a; b N/a N a int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length()); f 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 if(f<min) min = f; f<min f min min = f min f System.out.println(min) System.out.println System.out System System.out min String args[] args
import java.util.*;
 
 
class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        long N = sc.nextLong();
        long min = Integer.MAX_VALUE;

        for(long a=1; a<=Math.sqrt((double)N);a++){
            if(N%a==0){
                long b = N/a; 
                int f = Math.max(String.valueOf(a).length(),String.valueOf(b).length());
                if(f<min) min = f;
            }
            
        }
        System.out.println(min);

    }
}