import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	}

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

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	} main {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long n = scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner long min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		} 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){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		} {
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		} if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			} n % i == 0 n % i n i 0 {
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			} long x = n / i; x n / i n i String y = String.valueOf(i); y String.valueOf(i) String.valueOf String i String z = String.valueOf(x); z String.valueOf(x) String.valueOf String x long max = Math.max(y.length(), z.length()); max Math.max(y.length(), z.length()) Math.max Math y.length() y.length y z.length() z.length z min = Math.min(min, max) min Math.min(min, max) Math.min Math min max System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		long n = scanner.nextLong();
		long min = Integer.MAX_VALUE;
		for(long i=1;i<=Math.sqrt(n);i++){
			if(n % i == 0){
				long x = n / i;
				String y = String.valueOf(i);
				String z = String.valueOf(x);
				long max = Math.max(y.length(), z.length());
				min = Math.min(min, max);
			}
		}
		System.out.println(min);
	}

}
