import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	}

	public static int Fnum(long x, long y) {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	}

	public static int Fnum(long x, long y) {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	}
} Main public static void main(String[] args) {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	} main {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	} ArrayList<Long> a = new ArrayList<Long>(); a new ArrayList<Long>() ArrayList<Long> b = new ArrayList<Long>(); b new ArrayList<Long>() int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan double m = Math.sqrt(n); m Math.sqrt(n) Math.sqrt Math n for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		} long i = 1; long i = 1; i 1 i <= m+1 i m+1 m 1 i++ i++ i {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		} {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		} if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			} n%i == 0 n%i n i 0 {
				a.add(i);
				b.add(n/i);
			} a.add(i) a.add a i b.add(n/i) b.add b n/i n i for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		} int i = 0; int i = 0; i 0 i < a.size() i a.size() a.size a i++ i++ i {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		} {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		} int ans = Fnum(a.get(i), b.get(i)); ans Fnum(a.get(i), b.get(i)) Fnum a.get(i) a.get a i b.get(i) b.get b i if (ans < min) {
				min = ans;
			} ans < min ans min {
				min = ans;
			} min = ans min ans System.out.println(min) System.out.println System.out System System.out min String[] args args public static int Fnum(long x, long y) {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	} Fnum {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	} String s = String.valueOf(x); s String.valueOf(x) String.valueOf String x String t = String.valueOf(y); t String.valueOf(y) String.valueOf String y int A = s.length(); A s.length() s.length s int B = t.length(); B t.length() t.length t return Math.max(A, B); Math.max(A, B) Math.max Math A B long x x long y y public class Main {

	public static void main(String[] args) {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	}

	public static int Fnum(long x, long y) {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	}
} public class Main {

	public static void main(String[] args) {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	}

	public static int Fnum(long x, long y) {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		ArrayList<Long> a = new ArrayList<Long>();
		ArrayList<Long> b = new ArrayList<Long>();
		int min = Integer.MAX_VALUE;
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		double m = Math.sqrt(n);
		for (long i = 1; i <= m+1; i++) {
			if (n%i == 0) {
				a.add(i);
				b.add(n/i);
			}
		}
		for (int i = 0; i < a.size(); i++) {
			int ans = Fnum(a.get(i), b.get(i));
			if (ans < min) {
				min = ans;
			}
		}
		System.out.println(min);
	}

	public static int Fnum(long x, long y) {
		String s = String.valueOf(x);
		String t = String.valueOf(y);
		int A = s.length();
		int B = t.length();
		return Math.max(A, B);
	}
}
