
import java.util.*;
import java.math.*;

 class Main {
     static boolean[][] graph = new boolean[8][8];

     public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Nw= N;
        long[] yaku=new long[100000];
        int k=0;
        long root = (long) Math.pow(N,1.0/2.0)+1;
        
        for(long i=1;i<root;i++) {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        }
//        System.out.println(Nw);
//        System.out.println("k="+k);
        long ans=999;
        for(int i=k-1;i>=0;i--) {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        }
        System.out.println(ans);
     }   
    static int dfs(int first, int max, boolean[] visited) {
    	int ret = 0;
    	boolean all_visited = true;
    	for(int i=0;i<max;i++) {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	}
    	if (all_visited) {
    		return 1;
    	}
    	
    	for(int i=0;i<max;i++) {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	}
    	return ret;
    }
} import java.util.*; util.* java import java.math.*; math.* java class Main {
     static boolean[][] graph = new boolean[8][8];

     public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Nw= N;
        long[] yaku=new long[100000];
        int k=0;
        long root = (long) Math.pow(N,1.0/2.0)+1;
        
        for(long i=1;i<root;i++) {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        }
//        System.out.println(Nw);
//        System.out.println("k="+k);
        long ans=999;
        for(int i=k-1;i>=0;i--) {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        }
        System.out.println(ans);
     }   
    static int dfs(int first, int max, boolean[] visited) {
    	int ret = 0;
    	boolean all_visited = true;
    	for(int i=0;i<max;i++) {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	}
    	if (all_visited) {
    		return 1;
    	}
    	
    	for(int i=0;i<max;i++) {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	}
    	return ret;
    }
} Main static boolean[][] graph = new boolean[8][8]; graph new boolean[8][8] 8 8 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Nw= N;
        long[] yaku=new long[100000];
        int k=0;
        long root = (long) Math.pow(N,1.0/2.0)+1;
        
        for(long i=1;i<root;i++) {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        }
//        System.out.println(Nw);
//        System.out.println("k="+k);
        long ans=999;
        for(int i=k-1;i>=0;i--) {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        }
        System.out.println(ans);
     } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Nw= N;
        long[] yaku=new long[100000];
        int k=0;
        long root = (long) Math.pow(N,1.0/2.0)+1;
        
        for(long i=1;i<root;i++) {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        }
//        System.out.println(Nw);
//        System.out.println("k="+k);
        long ans=999;
        for(int i=k-1;i>=0;i--) {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        }
        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 Nw= N; Nw N long[] yaku=new long[100000]; yaku new long[100000] 100000 int k=0; k 0 long root = (long) Math.pow(N,1.0/2.0)+1; root (long) Math.pow(N,1.0/2.0)+1 (long) Math.pow(N,1.0/2.0) Math.pow Math N 1.0/2.0 1.0 2.0 1 for(long i=1;i<root;i++) {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        } long i=1; long i=1; i 1 i<root i root i++ i++ i {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        } {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        } if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	} Nw%i==0 Nw%i Nw i 0 {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	} yaku[k]=i yaku[k] yaku k i k++ k long ans=999; ans 999 for(int i=k-1;i>=0;i--) {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        } int i=k-1; int i=k-1; i k-1 k 1 i>=0 i 0 i-- i-- i {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        } {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        } long A=yaku[i]; A yaku[i] yaku i long B=N/yaku[i]; B N/yaku[i] N yaku[i] yaku i long result=Math.max(A, B); result Math.max(A, B) Math.max Math A B if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length(); String.valueOf(result).length()<ans String.valueOf(result).length() String.valueOf(result).length String.valueOf(result) String.valueOf String result ans ans=String.valueOf(result).length() ans String.valueOf(result).length() String.valueOf(result).length String.valueOf(result) String.valueOf String result System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int dfs(int first, int max, boolean[] visited) {
    	int ret = 0;
    	boolean all_visited = true;
    	for(int i=0;i<max;i++) {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	}
    	if (all_visited) {
    		return 1;
    	}
    	
    	for(int i=0;i<max;i++) {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	}
    	return ret;
    } dfs {
    	int ret = 0;
    	boolean all_visited = true;
    	for(int i=0;i<max;i++) {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	}
    	if (all_visited) {
    		return 1;
    	}
    	
    	for(int i=0;i<max;i++) {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	}
    	return ret;
    } int ret = 0; ret 0 boolean all_visited = true; all_visited true for(int i=0;i<max;i++) {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	} int i=0; int i=0; i 0 i<max i max i++ i++ i {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	} {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	} if(visited[i]==false) {
    			all_visited=false;    			
    		} visited[i]==false visited[i] visited i false {
    			all_visited=false;    			
    		} all_visited=false all_visited false if (all_visited) {
    		return 1;
    	} all_visited {
    		return 1;
    	} return 1; 1 for(int i=0;i<max;i++) {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	} int i=0; int i=0; i 0 i<max i max i++ i++ i {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	} {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	} if(graph[first][i]==false) {
    			continue;
    		} graph[first][i]==false graph[first][i] graph[first] graph first i false {
    			continue;
    		} continue; if(visited[i]==true) {
    			continue;
    		} visited[i]==true visited[i] visited i true {
    			continue;
    		} continue; visited[i]=true visited[i] visited i true ret += dfs(i,max,visited) ret dfs(i,max,visited) dfs i max visited visited[i] = false visited[i] visited i false return ret; ret int first first int max max boolean[] visited visited

import java.util.*;
import java.math.*;

 class Main {
     static boolean[][] graph = new boolean[8][8];

     public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Nw= N;
        long[] yaku=new long[100000];
        int k=0;
        long root = (long) Math.pow(N,1.0/2.0)+1;
        
        for(long i=1;i<root;i++) {
        	if(Nw%i==0) {
        		yaku[k]=i;
//                System.out.println(i);
        		k++;
        	}
        }
//        System.out.println(Nw);
//        System.out.println("k="+k);
        long ans=999;
        for(int i=k-1;i>=0;i--) {
            long A=yaku[i];
            long B=N/yaku[i];
            long result=Math.max(A, B);
//          System.out.println("A=" + A);
//          System.out.println("B=" + B);
            if (String.valueOf(result).length()<ans)ans=String.valueOf(result).length();
        }
        System.out.println(ans);
     }   
    static int dfs(int first, int max, boolean[] visited) {
    	int ret = 0;
    	boolean all_visited = true;
    	for(int i=0;i<max;i++) {
    		if(visited[i]==false) {
    			all_visited=false;    			
    		}
    	}
    	if (all_visited) {
    		return 1;
    	}
    	
    	for(int i=0;i<max;i++) {
    		if(graph[first][i]==false) {
    			continue;
    		}
    		if(visited[i]==true) {
    			continue;
    		}
    		visited[i]=true;
			ret += dfs(i,max,visited);
			visited[i] = false;
    	}
    	return ret;
    }
}