import java.util.Scanner;

class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		long N = sc.nextLong();

		int result = String.valueOf(N).length();

		for (long f = 2; f * f <= N; f++) {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		}
		System.out.println(result);
	}
}

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

		Solver.INSTANCE.solve(in);

		in.close();
	}
} import java.util.Scanner; Scanner java.util class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		long N = sc.nextLong();

		int result = String.valueOf(N).length();

		for (long f = 2; f * f <= N; f++) {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		}
		System.out.println(result);
	}
} Solver static final Solver INSTANCE = new Solver(); INSTANCE new Solver() void solve(Scanner sc) {
		long N = sc.nextLong();

		int result = String.valueOf(N).length();

		for (long f = 2; f * f <= N; f++) {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		}
		System.out.println(result);
	} solve {
		long N = sc.nextLong();

		int result = String.valueOf(N).length();

		for (long f = 2; f * f <= N; f++) {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		}
		System.out.println(result);
	} long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int result = String.valueOf(N).length(); result String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N for (long f = 2; f * f <= N; f++) {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		} long f = 2; long f = 2; f 2 f * f <= N f * f f f N f++ f++ f {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		} {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		} if (N % f != 0) continue; N % f != 0 N % f N f 0 continue; result = Math.min(result, String.valueOf(N / f).length()) result Math.min(result, String.valueOf(N / f).length()) Math.min Math result String.valueOf(N / f).length() String.valueOf(N / f).length String.valueOf(N / f) String.valueOf String N / f N f System.out.println(result) System.out.println System.out System System.out result Scanner sc sc class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
} Main public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} main {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) Solver.INSTANCE.solve(in) Solver.INSTANCE.solve Solver.INSTANCE Solver Solver.INSTANCE in in.close() in.close in String... args args
import java.util.Scanner;

class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		long N = sc.nextLong();

		int result = String.valueOf(N).length();

		for (long f = 2; f * f <= N; f++) {
			if (N % f != 0) continue;
			result = Math.min(result, String.valueOf(N / f).length());
		}
		System.out.println(result);
	}
}

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

		Solver.INSTANCE.solve(in);

		in.close();
	}
}