import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    } main {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner int n = (int)Math.sqrt(N); n (int)Math.sqrt(N) Math.sqrt Math N int X = 0; X 0 for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        } int i=1; int i=1; i 1 i<=n i n i++ i++ i {
            if(N%i==0){
                X = i;
            }
        } {
            if(N%i==0){
                X = i;
            }
        } if(N%i==0){
                X = i;
            } N%i==0 N%i N i 0 {
                X = i;
            } X = i X i N /= X N X int valLenN = String.valueOf(N).length(); valLenN String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N int valLenX = String.valueOf(X).length(); valLenX String.valueOf(X).length() String.valueOf(X).length String.valueOf(X) String.valueOf String X if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        } valLenX<=valLenN valLenX valLenN {
            System.out.println(valLenN);
        } System.out.println(valLenN) System.out.println System.out System System.out valLenN {
            System.out.println(valLenX);
        } System.out.println(valLenX) System.out.println System.out System System.out valLenX String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner scanner = new Scanner(System.in);
        long N = scanner.nextLong();
        int n = (int)Math.sqrt(N);
        int X = 0;
        
        for(int i=1; i<=n; i++){
            if(N%i==0){
                X = i;
            }
        }
        
        N /= X;
        
        int valLenN = String.valueOf(N).length();
        int valLenX = String.valueOf(X).length();
        
        if(valLenX<=valLenN){
            System.out.println(valLenN);
        }else{
            System.out.println(valLenX);
        }
        
        
    }
}
