import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = Long.parseLong(sc.next()); n Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc int f = 100; f 100 for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		} int i = 1; int i = 1; i 1 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		} {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		} if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			} n % i == 0 n % i n i 0 {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			} int tmpA = i; tmpA i int fa = 0; fa 0 while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				} tmpA != 0 tmpA 0 {
					tmpA /= 10;
					fa++;
				} tmpA /= 10 tmpA 10 fa++ fa int tmpB = (int) (n / i); tmpB (int) (n / i) n i int fb = 0; fb 0 while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				} tmpB != 0 tmpB 0 {
					tmpB /= 10;
					fb++;
				} tmpB /= 10 tmpB 10 fb++ fb f = Math.min(f, Math.max(fa, fb)) f Math.min(f, Math.max(fa, fb)) Math.min Math f Math.max(fa, fb) Math.max Math fa fb System.out.println(f) System.out.println System.out System System.out f sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long n = Long.parseLong(sc.next());

		int f = 100;
		for (int i = 1; i <= Math.sqrt(n); i++) {

			if (n % i == 0) {
				int tmpA = i;
				int fa = 0;
				while (tmpA != 0) {
					tmpA /= 10;
					fa++;
				}
				int tmpB = (int) (n / i);
				int fb = 0;
				while (tmpB != 0) {
					tmpB /= 10;
					fb++;
				}

				f = Math.min(f, Math.max(fa, fb));
			}
		}

		System.out.println(f);
		sc.close();
	}
}