

import java.util.Scanner;

public class Main {

	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();

		int minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	}
} 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 minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	}
} Main public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();

		int minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	} main {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();

		int minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc int minLen = Integer.MAX_VALUE; minLen Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		} int i = 1; int i = 1; i 1 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		} {
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		} if(n % i != 0){
				continue;
			} n % i != 0 n % i n i 0 {
				continue;
			} continue; String a = Integer.toString(i); a Integer.toString(i) Integer.toString Integer i String b = Long.toString(n / i); b Long.toString(n / i) Long.toString Long n / i n i minLen = Math.min(minLen, Math.max(a.length(), b.length())) minLen Math.min(minLen, Math.max(a.length(), b.length())) Math.min Math minLen Math.max(a.length(), b.length()) Math.max Math a.length() a.length a b.length() b.length b System.out.println(minLen) System.out.println System.out System System.out minLen String[] args args public class Main {

	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();

		int minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	}
} public class Main {

	public static void main(String[] args)  {
		Scanner sc = new Scanner(System.in);

		long n = sc.nextLong();

		int minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	}
} 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 minLen = Integer.MAX_VALUE;
		for(int i = 1; i <= Math.sqrt(n); i++){
			if(n % i != 0){
				continue;
			}
			String a = Integer.toString(i);
			String b = Long.toString(n / i);

			minLen = Math.min(minLen, Math.max(a.length(), b.length()));
		}

		System.out.println(minLen);
	}
}