
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	}
	public static boolean isPrime(long n){
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	}
	public static int largestMultiplier(long n){
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	}
	public static int digitLength(long n){
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	}
	public static boolean isPrime(long n){
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	}
	public static int largestMultiplier(long n){
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	}
	public static int digitLength(long n){
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	}
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	} main {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) long n = in.nextLong(); n in.nextLong() in.nextLong in if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        } n==1 n 1 System.out.println(1) System.out.println System.out System System.out 1 if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        } isPrime(n) isPrime n System.out.println(digitLength(n)) System.out.println System.out System System.out digitLength(n) digitLength n {
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        } if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	} n/10==0 n/10 n 10 0 System.out.println(2) System.out.println System.out System System.out 2 {
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	} int mul1 = largestMultiplier(n); mul1 largestMultiplier(n) largestMultiplier n int mul2 = (int)(n/mul1); mul2 (int)(n/mul1) n mul1 System.out.println(Math.max(digitLength(mul1), digitLength(mul2))) System.out.println System.out System System.out Math.max(digitLength(mul1), digitLength(mul2)) Math.max Math digitLength(mul1) digitLength mul1 digitLength(mul2) digitLength mul2 String[] args args public static boolean isPrime(long n){
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	} isPrime {
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	} if (n==2||n==3) return true; n==2||n==3 n==2 n 2 n==3 n 3 return true; true if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		} n%2==0 n%2 n 2 0 return false; false {
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		} int square = (int)Math.sqrt(n); square (int)Math.sqrt(n) Math.sqrt Math n for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			} int i=3; int i=3; i 3 i<=square i square i=i+2 i=i+2 i i+2 i 2 {
				if (n%i==0){
					return false;
				}
			} {
				if (n%i==0){
					return false;
				}
			} if (n%i==0){
					return false;
				} n%i==0 n%i n i 0 {
					return false;
				} return false; false return true; true long n n public static int largestMultiplier(long n){
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	} largestMultiplier {
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	} int max = 0; max 0 int square = (int)Math.sqrt(n); square (int)Math.sqrt(n) Math.sqrt Math n for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		} int i=2; int i=2; i 2 i<=square i square i++ i++ i {
			if (n%i==0){
				max = i;
			}
		} {
			if (n%i==0){
				max = i;
			}
		} if (n%i==0){
				max = i;
			} n%i==0 n%i n i 0 {
				max = i;
			} max = i max i return max; max long n n public static int digitLength(long n){
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	} digitLength {
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	} int length = 0; length 0 while(n>0){
			n = n/10;
			length ++;
		} n>0 n 0 {
			n = n/10;
			length ++;
		} n = n/10 n n/10 n 10 length ++ length return length; length long n n public class Main{

	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	}
	public static boolean isPrime(long n){
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	}
	public static int largestMultiplier(long n){
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	}
	public static int digitLength(long n){
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	}
} public class Main{

	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	}
	public static boolean isPrime(long n){
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	}
	public static int largestMultiplier(long n){
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	}
	public static int digitLength(long n){
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	}
} Main

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        if (n==1) System.out.println(1);
        else if (isPrime(n)) System.out.println(digitLength(n));
        else{
        	if (n/10==0) System.out.println(2);
        	else{
        		int mul1 = largestMultiplier(n);
        		int mul2 = (int)(n/mul1);
        		System.out.println(Math.max(digitLength(mul1), digitLength(mul2)));
        	}
        }
	}
	public static boolean isPrime(long n){
		if (n==2||n==3) return true;
		if (n%2==0) return false;
		else{
			int square = (int)Math.sqrt(n);
			for (int i=3;i<=square;i=i+2){
				if (n%i==0){
					return false;
				}
			}
		}
		return true;
	}
	public static int largestMultiplier(long n){
		int max = 0;
		int square = (int)Math.sqrt(n);
		for (int i=2;i<=square;i++){
			if (n%i==0){
				max = i;
			}
		}
		return max;
	}
	public static int digitLength(long n){
		int length = 0;
		while(n>0){
			n = n/10;
			length ++;
		}
		return length;
	}
}
