import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	}

} 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();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	}

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

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	} main {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc int sqrt = (int) Math.floor(Math.sqrt(n)); sqrt (int) Math.floor(Math.sqrt(n)) Math.floor Math Math.sqrt(n) Math.sqrt Math n int min_Keta = String.valueOf(n).length(); min_Keta String.valueOf(n).length() String.valueOf(n).length String.valueOf(n) String.valueOf String n for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		} int i = 2; int i = 2; i 2 i <= sqrt i sqrt i++ i++ i {
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		} {
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		} if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			} n % i == 0 n % i n i 0 {
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			} min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length())) min_Keta Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length())) Math.min Math min_Keta 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_Keta) System.out.println System.out System System.out min_Keta String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();
		int sqrt = (int) Math.floor(Math.sqrt(n));
		int min_Keta = String.valueOf(n).length();

		for (int i = 2; i <= sqrt ; i++){
			if (n % i == 0){
				min_Keta = Math.min(min_Keta, Math.max(String.valueOf(i).length(),String.valueOf(n / i).length()));
			}
		}

		System.out.println(min_Keta);
	}

}
