import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private TreeSet<Long> divisors(long n) {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	}

	private int keta(long x) {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	}

	private int F(long a, long b) {
		return Math.max(keta(a), keta(b));
	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.TreeSet; TreeSet java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private TreeSet<Long> divisors(long n) {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	}

	private int keta(long x) {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	}

	private int F(long a, long b) {
		return Math.max(keta(a), keta(b));
	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out private TreeSet<Long> divisors(long n) {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	} divisors {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	} TreeSet<Long> result = new TreeSet<>(); result new TreeSet<>() for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		} long i = 1; long i = 1; i 1 i * i <= n i * i i i n i++ i++ i {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		} {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		} if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			} n % i == 0 n % i n i 0 {
				result.add(i);
				result.add(n / i);
			} result.add(i) result.add result i result.add(n / i) result.add result n / i n i return result; result long n n private int keta(long x) {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	} keta {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	} if (x == 0) {
			return 1;
		} x == 0 x 0 {
			return 1;
		} return 1; 1 int keta = 1; keta 1 while (x >= 10) {
			x /= 10;
			keta++;
		} x >= 10 x 10 {
			x /= 10;
			keta++;
		} x /= 10 x 10 keta++ keta return keta; keta long x x private int F(long a, long b) {
		return Math.max(keta(a), keta(b));
	} F {
		return Math.max(keta(a), keta(b));
	} return Math.max(keta(a), keta(b)); Math.max(keta(a), keta(b)) Math.max Math keta(a) keta a keta(b) keta b long a a long b b public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	} _main {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	} Scanner sc = new Scanner(in); sc new Scanner(in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc sc.close() sc.close sc TreeSet<Long> s = divisors(N); s divisors(N) divisors N int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		} long a s {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		} {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		} long b = N / a; b N / a N a ans = Math.min(ans, F(a, b)) ans Math.min(ans, F(a, b)) Math.min Math ans F(a, b) F a b out.println(ans) out.println out ans String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private TreeSet<Long> divisors(long n) {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	}

	private int keta(long x) {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	}

	private int F(long a, long b) {
		return Math.max(keta(a), keta(b));
	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private TreeSet<Long> divisors(long n) {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	}

	private int keta(long x) {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	}

	private int F(long a, long b) {
		return Math.max(keta(a), keta(b));
	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private TreeSet<Long> divisors(long n) {
		TreeSet<Long> result = new TreeSet<>();

		for (long i = 1; i * i <= n; i++) {
			if (n % i == 0) {
				result.add(i);
				result.add(n / i);
			}
		}

		return result;
	}

	private int keta(long x) {
		if (x == 0) {
			return 1;
		}
		int keta = 1;
		while (x >= 10) {
			x /= 10;
			keta++;
		}
		return keta;
	}

	private int F(long a, long b) {
		return Math.max(keta(a), keta(b));
	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		long N = sc.nextLong();

		sc.close();

		TreeSet<Long> s = divisors(N);

		int ans = Integer.MAX_VALUE;

		for (long a : s) {
			long b = N / a;
			ans = Math.min(ans, F(a, b));
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
}
