import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		System.out.println(min);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		System.out.println(min);
	}
} Main @SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		System.out.println(min);
	} main {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		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 int min=1000000000; min 1000000000 for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		} int i=(int)Math.sqrt(n)+1; int i=(int)Math.sqrt(n)+1; i (int)Math.sqrt(n)+1 (int)Math.sqrt(n) Math.sqrt Math n 1 i>0 i 0 i-- i-- i {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		} {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		} if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			} n%i==0 n%i n i 0 {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			} min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length())) min Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length())) Math.min Math min (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()) Math.max Math String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i String.valueOf(n/i).length() String.valueOf(n/i).length String.valueOf(n/i) String.valueOf String n/i n i System.out.println(min) System.out.println System.out System System.out min String args[] args public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		System.out.println(min);
	}
} public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		System.out.println(min);
	}
} Main
import java.util.Scanner;

public class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		int min=1000000000;
		for(int i=(int)Math.sqrt(n)+1;i>0;i--) {
			if(n%i==0) {
				min=Math.min(min, (int)Math.max(String.valueOf(i).length(), String.valueOf(n/i).length()));
			}
		}
		System.out.println(min);
	}
}