import java.util.Scanner;

public class Main {


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

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		System.out.println(ans);

	}
	private static int comp(long m, long n) {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	}
} import java.util.Scanner; Scanner java.util public class Main {


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

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		System.out.println(ans);

	}
	private static int comp(long m, long n) {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		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 sc.close() sc.close sc int p = (int)Math.pow(N, 0.5); p (int)Math.pow(N, 0.5) Math.pow Math N 0.5 int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		} int i = 1 ; int i = 1 ; i 1 i <= p i p i++ i++ i {
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		} {
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		} if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			} N%i == 0 N%i N i 0 {
				ans = Math.min(ans, comp(i,N/i));
			} ans = Math.min(ans, comp(i,N/i)) ans Math.min(ans, comp(i,N/i)) Math.min Math ans comp(i,N/i) comp i N/i N i System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static int comp(long m, long n) {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	} comp {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	} if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    } Long.toString(m).length() >= Long.toString(n).length() Long.toString(m).length() Long.toString(m).length Long.toString(m) Long.toString Long m Long.toString(n).length() Long.toString(n).length Long.toString(n) Long.toString Long n {
	    	return Long.toString(m).length();
	    } return Long.toString(m).length(); Long.toString(m).length() Long.toString(m).length Long.toString(m) Long.toString Long m {
	    	return Long.toString(n).length();
	    } return Long.toString(n).length(); Long.toString(n).length() Long.toString(n).length Long.toString(n) Long.toString Long n long m m long n n public class Main {


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

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		System.out.println(ans);

	}
	private static int comp(long m, long n) {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	}
} public class Main {


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

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		System.out.println(ans);

	}
	private static int comp(long m, long n) {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	}
} Main
import java.util.Scanner;

public class Main {


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

		int p = (int)Math.pow(N, 0.5);

		int ans = Integer.MAX_VALUE;
		for(int i = 1 ; i <= p ; i++){
			if(N%i == 0){
				ans = Math.min(ans, comp(i,N/i));
			}
		}

		System.out.println(ans);

	}
	private static int comp(long m, long n) {
	    if(Long.toString(m).length() >= Long.toString(n).length()){
	    	return Long.toString(m).length();
	    }
	    else{
	    	return Long.toString(n).length();
	    }
	}
}
