import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	}
} Main public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	} main {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	} try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long temp = 0L; temp 0L int ret = 10; ret 10 for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			} long i = 1L; long i = 1L; i 1L i <= 100000 i 100000 i++ i++ i {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			} {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			} if(!(N % i == 0)) {
					continue;
				} !(N % i == 0) (N % i == 0) N % i N i 0 {
					continue;
				} continue; temp = Math.max(N /i, i) temp Math.max(N /i, i) Math.max Math N /i N i i ret = Math.min(ret, String.valueOf(temp).length()) ret Math.min(ret, String.valueOf(temp).length()) Math.min Math ret String.valueOf(temp).length() String.valueOf(temp).length String.valueOf(temp) String.valueOf String temp System.out.println(ret) System.out.println System.out System System.out ret String[] args args public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	}
} public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		try (Scanner sc = new Scanner(System.in)) {
			long N = Long.parseLong(sc.next());
			long temp = 0L;
			int ret = 10;
			// Set<Long> s = new HashSet<>();
			for(long i = 1L; i <= 100000; i++) {
				if(!(N % i == 0)) {
					continue;
				}
				// System.out.println("F(" + (N /i) + ", " + i + ")");
				temp = Math.max(N /i, i);
				// if(!s.add(temp)) break;
				ret = Math.min(ret, String.valueOf(temp).length());
			}
			System.out.println(ret);
		} // Scanner Close
	}
}