
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc sc.close() sc.close sc int min = Long.toString(N).length(); min Long.toString(N).length() Long.toString(N).length Long.toString(N) Long.toString Long N for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		} long i = 2; long i = 2; i 2 i * i <= N i * i i i N i++ i++ i {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		} {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		} if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			} N % i == 0 N % i N i 0 {
				min = Math.min(min, Long.toString(N / i).length());
			} min = Math.min(min, Long.toString(N / i).length()) min Math.min(min, Long.toString(N / i).length()) Math.min Math min Long.toString(N / i).length() Long.toString(N / i).length Long.toString(N / i) Long.toString Long 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 void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		int min = Long.toString(N).length();
		for(long i = 2; i * i <= N; i++) {
			if(N % i == 0) {
				min = Math.min(min, Long.toString(N / i).length());
			}
		}
		System.out.println(min);
	}
}