import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	}
	
	static int f (long a, long b) {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	}
	
} 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 ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	}
	
	static int f (long a, long b) {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	}
	
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long ans = Long.MAX_VALUE; ans Long.MAX_VALUE Long Long.MAX_VALUE for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		} long a = 1; long a = 1; a 1 a*a <= n a*a a a n a++ a++ a {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		} {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		} if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			} n%a==0 n%a n a 0 {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} long b = n / a; b n / a n a long calc = f(a,b); calc f(a,b) f a b ans = Math.min(ans,calc) ans Math.min(ans,calc) Math.min Math ans calc {
				continue;
			} continue; System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args static int f (long a, long b) {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	} f {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	} long max = Math.max(a,b); max Math.max(a,b) Math.max Math a b String str = String.valueOf(max); str String.valueOf(max) String.valueOf String max return str.length(); str.length() str.length str long a a long b b public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	}
	
	static int f (long a, long b) {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	}
	
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	}
	
	static int f (long a, long b) {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	}
	
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long ans = Long.MAX_VALUE;
		
		for (long a = 1; a*a <= n; a++) {
			if (n%a==0) {
				long b = n / a;
				long calc = f(a,b);
				ans = Math.min(ans,calc);
			} else {
				continue;
			}
		}
		System.out.println(ans);
		
		sc.close();
	}
	
	static int f (long a, long b) {
		long max = Math.max(a,b);
		String str = String.valueOf(max);
		return str.length();
	}
	
}
