import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	}

	public static int func(String a, String b) {
		return Math.max(a.length(), b.length());
	}

} 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 ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	}

	public static int func(String a, String b) {
		return Math.max(a.length(), b.length());
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc int ans = 100000; ans 100000 for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		} long i = 1 ; long i = 1 ; i 1 i * i <= 10000000000L i * i i i 10000000000L i++ i++ i {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		} {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		} if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			} n % i == 0 n % i n i 0 {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			} ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i))) ans Math.min(ans, func(String.valueOf(i), String.valueOf(n / i))) Math.min Math ans func(String.valueOf(i), String.valueOf(n / i)) func String.valueOf(i) String.valueOf String i String.valueOf(n / i) String.valueOf String n / i n i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int func(String a, String b) {
		return Math.max(a.length(), b.length());
	} func {
		return Math.max(a.length(), b.length());
	} return Math.max(a.length(), b.length()); Math.max(a.length(), b.length()) Math.max Math a.length() a.length a b.length() b.length b String a a String b b public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	}

	public static int func(String a, String b) {
		return Math.max(a.length(), b.length());
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	}

	public static int func(String a, String b) {
		return Math.max(a.length(), b.length());
	}

} 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 ans = 100000;
		for(long i = 1 ; i * i <= 10000000000L ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, func(String.valueOf(i), String.valueOf(n / i)));
			}
		}
		System.out.println(ans);
	}

	public static int func(String a, String b) {
		return Math.max(a.length(), b.length());
	}

}
