
import java.util.Scanner;

public class Main {

	public static int f(long a, long b) {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static int f(long a, long b) {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	}

} Main public static int f(long a, long b) {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	} f {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	} int digit = 0; digit 0 if(a < 0 && b < 0)return -1; a < 0 && b < 0 a < 0 a 0 b < 0 b 0 return -1; -1 1 long tmp = (long)Math.max(a, b); tmp (long)Math.max(a, b) Math.max Math a b while(tmp > 0) {
			tmp /= 10;
			++digit;
		} tmp > 0 tmp 0 {
			tmp /= 10;
			++digit;
		} tmp /= 10 tmp 10 ++digit digit return digit; digit long a a long b b public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n; n n = sc.nextLong() n sc.nextLong() sc.nextLong sc sc.close() sc.close sc int min = 100; min 100 for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		} int i = 1; int i = 1; i 1 i <= (int)Math.sqrt(n) i (int)Math.sqrt(n) Math.sqrt Math n ++i ++i i {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		} {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		} if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			} n % i == 0 n % i n i 0 {
				min = Math.min(min,  f((n / (long)i), (long)i));
			} min = Math.min(min,  f((n / (long)i), (long)i)) min Math.min(min,  f((n / (long)i), (long)i)) Math.min Math min f((n / (long)i), (long)i) f (n / (long)i) n (long)i (long)i System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {

	public static int f(long a, long b) {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	}

} public class Main {

	public static int f(long a, long b) {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	}

} Main

import java.util.Scanner;

public class Main {

	public static int f(long a, long b) {
		int digit = 0;
		
		if(a < 0 && b < 0)return -1;
		
		long tmp = (long)Math.max(a, b);
		
		while(tmp > 0) {
			tmp /= 10;
			++digit;
		}
		
		return digit;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		n = sc.nextLong();
		sc.close();
		
		int min = 100;
		for(int i = 1; i <= (int)Math.sqrt(n); ++i) {
			if(n % i == 0) {
				min = Math.min(min,  f((n / (long)i), (long)i));
			}
		}
		System.out.println(min);
	}

}
