import java.util.*;

public class Main {
    static long ans = 1001001001001001018L;;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        System.out.println(ans);
    }
        
    public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    }
} import java.util.*; util.* java public class Main {
    static long ans = 1001001001001001018L;;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        System.out.println(ans);
    }
        
    public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    }
} Main static long ans = 1001001001001001018L; ans 1001001001001001018L public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        System.out.println(ans);
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        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 divisorList(n) divisorList n System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    } divisorList {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    } List<Long> res = new ArrayList<Long>(); res new ArrayList<Long>() for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        } long i = 1; long i = 1; i 1 i * i <= n i * i i i n i++ i++ i {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        } {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        } if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            } n % i == 0 n % i n i 0 {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            } res.add(i) res.add res i long j = n / i; j n / i n i if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                } j != i j i {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } res.add(j) res.add res j String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String t = String.valueOf(j); t String.valueOf(j) String.valueOf String j ans = Math.min(ans, Math.max(s.length(), t.length())) ans Math.min(ans, Math.max(s.length(), t.length())) Math.min Math ans Math.max(s.length(), t.length()) Math.max Math s.length() s.length s t.length() t.length t {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                } String u = String.valueOf(i); u String.valueOf(i) String.valueOf String i ans = Math.min(ans, u.length()) ans Math.min(ans, u.length()) Math.min Math ans u.length() u.length u res.sort(Comparator.naturalOrder()) res.sort res Comparator.naturalOrder() Comparator.naturalOrder Comparator return res; res long n n public class Main {
    static long ans = 1001001001001001018L;;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        System.out.println(ans);
    }
        
    public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    }
} public class Main {
    static long ans = 1001001001001001018L;;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        System.out.println(ans);
    }
        
    public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    }
} Main
import java.util.*;

public class Main {
    static long ans = 1001001001001001018L;;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        divisorList(n);
        System.out.println(ans);
    }
        
    public static List<Long> divisorList(long n) {
        List<Long> res = new ArrayList<Long>();
        for (long i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                res.add(i);
                
                long j = n / i;
                if (j != i) {
                    res.add(j);
                    
                    String s = String.valueOf(i);
                    String t = String.valueOf(j);
                    ans = Math.min(ans, Math.max(s.length(), t.length()));
                } else {
                    String u = String.valueOf(i);
                    ans = Math.min(ans, u.length());
                }
            }
        }
        res.sort(Comparator.naturalOrder());
        
        return res;
    }
}
