import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        System.out.println(min);
    }

    private static int f(long a,long b){
        return Math.max(digit(a),digit(b));
    }

    private static int digit(long n){
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        System.out.println(min);
    }

    private static int f(long a,long b){
        return Math.max(digit(a),digit(b));
    }

    private static int digit(long n){
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    }

} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        System.out.println(min);
    } main {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        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 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        } int i=1; int i=1; i 1 i<Math.sqrt(n)+1 i Math.sqrt(n)+1 Math.sqrt(n) Math.sqrt Math n 1 i++ i++ i {
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        } {
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        } if(n%i==0){
                min = Math.min(min,f(i,n/i));
            } n%i==0 n%i n i 0 {
                min = Math.min(min,f(i,n/i));
            } min = Math.min(min,f(i,n/i)) min Math.min(min,f(i,n/i)) Math.min Math min f(i,n/i) f i n/i n i System.out.println(min) System.out.println System.out System System.out min String[] args args private static int f(long a,long b){
        return Math.max(digit(a),digit(b));
    } f {
        return Math.max(digit(a),digit(b));
    } return Math.max(digit(a),digit(b)); Math.max(digit(a),digit(b)) Math.max Math digit(a) digit a digit(b) digit b long a a long b b private static int digit(long n){
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    } digit {
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    } int i=1; i 1 while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        } true {
            if(n<10)return i;
            i++;
            n=n/10;
        } if(n<10)return i; n<10 n 10 return i; i i++ i n=n/10 n n/10 n 10 long n n public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        System.out.println(min);
    }

    private static int f(long a,long b){
        return Math.max(digit(a),digit(b));
    }

    private static int digit(long n){
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    }

} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        System.out.println(min);
    }

    private static int f(long a,long b){
        return Math.max(digit(a),digit(b));
    }

    private static int digit(long n){
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        Long n = sc.nextLong();
        int min = Integer.MAX_VALUE;
        for(int i=1;i<Math.sqrt(n)+1;i++){
            if(n%i==0){
                min = Math.min(min,f(i,n/i));
            }
        }
        System.out.println(min);
    }

    private static int f(long a,long b){
        return Math.max(digit(a),digit(b));
    }

    private static int digit(long n){
        int i=1;
        while(true){
            if(n<10)return i;
            i++;
            n=n/10;
        }
    }

}
