import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long answer = n; answer n for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        } long i = 1; long i = 1; i 1 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        } {
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        } if(n % i != 0) continue; n % i != 0 n % i n i 0 continue; long len1 = String.valueOf(i).length(); len1 String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i long len2 = String.valueOf(n / i).length(); len2 String.valueOf(n / i).length() String.valueOf(n / i).length String.valueOf(n / i) String.valueOf String n / i n i answer = Math.min(answer, Math.max(len1, len2)) answer Math.min(answer, Math.max(len1, len2)) Math.min Math answer Math.max(len1, len2) Math.max Math len1 len2 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();

        long answer = n;

        for(long i = 1; i <= Math.sqrt(n); i++){
          if(n % i != 0) continue;
          long len1 = String.valueOf(i).length();
          long len2 = String.valueOf(n / i).length();
          answer = Math.min(answer, Math.max(len1, len2));
        }

        System.out.println(answer);
	}
}