import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Map;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	}

	public static final ArrayList<Long> divisor(final long n) {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Map; Map java.util public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	}

	public static final ArrayList<Long> divisor(final long n) {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	}

} Main public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) long n = Long.parseLong(br.readLine()); n Long.parseLong(br.readLine()) Long.parseLong Long br.readLine() br.readLine br ArrayList<Long> list = divisor(n); list divisor(n) divisor n int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i += 2 i += 2 i 2 {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		} {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		} long a = 0; a 0 long b = 0; b 0 if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			} i == list.size() - 1 i list.size() - 1 list.size() list.size list 1 {
				a = list.get(i);
				b = list.get(i);
			} a = list.get(i) a list.get(i) list.get list i b = list.get(i) b list.get(i) list.get list i {
				a = list.get(i);
				b = list.get(i + 1);
			} a = list.get(i) a list.get(i) list.get list i b = list.get(i + 1) b list.get(i + 1) list.get list i + 1 i 1 String A = String.valueOf(a); A String.valueOf(a) String.valueOf String a String B = String.valueOf(b); B String.valueOf(b) String.valueOf String b int max = Math.max(A.length(), B.length()); max Math.max(A.length(), B.length()) Math.max Math A.length() A.length A B.length() B.length B ans = Math.min(ans, max) ans Math.min(ans, max) Math.min Math ans max System.out.println(ans) System.out.println System.out System System.out ans String args[] args public static final ArrayList<Long> divisor(final long n) {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	} divisor {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	} final ArrayList<Long> list = new ArrayList<>(); list new ArrayList<>() for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		} long i = 1; long i = 1; i 1 i * i <= n i * i i i n i++ i++ i { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		} { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		} if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			} n % i == 0 n % i n i 0 {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			} list.add(i) list.add list i if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				} i != n / i i n / i n i {
					list.add(n / i); // b x a (逆向き)
				} list.add(n / i) list.add list n / i n i return list; list final long n n public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	}

	public static final ArrayList<Long> divisor(final long n) {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	}

} public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	}

	public static final ArrayList<Long> divisor(final long n) {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Map;

public class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		long n = Long.parseLong(br.readLine());

		ArrayList<Long> list = divisor(n);

		int ans = Integer.MAX_VALUE;
		for (int i = 0; i < list.size(); i += 2) {
			long a = 0;
			long b = 0;
			if (i == list.size() - 1) {
				a = list.get(i);
				b = list.get(i);
			} else {
				a = list.get(i);
				b = list.get(i + 1);
			}

			String A = String.valueOf(a);
			String B = String.valueOf(b);

			int max = Math.max(A.length(), B.length());

			ans = Math.min(ans, max);
		}

		System.out.println(ans);
	}

	public static final ArrayList<Long> divisor(final long n) {
		final ArrayList<Long> list = new ArrayList<>();

		for (long i = 1; i * i <= n; i++) { // √n
			if (n % i == 0) {
				list.add(i); // a x b
				if (i != n / i) {
					list.add(n / i); // b x a (逆向き)
				}
			}
		}
		return list;
	}

}
