import java.util.*;
public class Main {
	public static int f(long A, long B) {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	}

} import java.util.*; util.* java public class Main {
	public static int f(long A, long B) {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	}

} Main public static int f(long A, long B) {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	} f {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	} int a = (int)String.valueOf(A).length(); a (int)String.valueOf(A).length() String.valueOf(A).length String.valueOf(A) String.valueOf String A int b = (int)String.valueOf(B).length(); b (int)String.valueOf(B).length() String.valueOf(B).length String.valueOf(B) String.valueOf String B return Math.max(a, b); Math.max(a, b) Math.max Math a b long A A long B B public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	} main {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) long N = stdIn.nextLong(); N stdIn.nextLong() stdIn.nextLong stdIn int min = f(1, N); min f(1, N) f 1 N for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		} int i = 1; int i = 1; i 1 i < Math.sqrt(N)+1 i Math.sqrt(N)+1 Math.sqrt(N) Math.sqrt Math N 1 i++ i++ i {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		} {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		} if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			} N%i == 0 N%i N i 0 {
				min = Math.min(min, f(i, N/i));
			} min = Math.min(min, f(i, N/i)) min Math.min(min, f(i, N/i)) Math.min Math min f(i, N/i) f i N/i N i System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
	public static int f(long A, long B) {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	}

} public class Main {
	public static int f(long A, long B) {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	}

} Main
import java.util.*;
public class Main {
	public static int f(long A, long B) {
		int a = (int)String.valueOf(A).length();
		int b = (int)String.valueOf(B).length();
		return Math.max(a, b);
	}

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		long N = stdIn.nextLong();
		
		int min = f(1, N);
		for(int i = 1; i < Math.sqrt(N)+1; i++) {
			if(N%i == 0) {
				min = Math.min(min, f(i, N/i));
			}
		}
		
		System.out.println(min);

	}

}