import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		// for (; solver.hasNextN();) {
		// solver.readN(in.readLine());
		// }
		// for (; solver.hasNextM();) {
		// solver.readM(in.readLine());
		// }
		// solver.solve();
	}
}

class Solver {
	public void init() {
	}

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		long N = Long.parseLong(strArr[0]);
		int ans = 0;
		for (long i = N; i > 0; i /= 10) {
			ans++;
		}
		for (long d = 1; d * d <= N; d++) {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		}
		System.out.println(ans);
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		// for (; solver.hasNextN();) {
		// solver.readN(in.readLine());
		// }
		// for (; solver.hasNextM();) {
		// solver.readM(in.readLine());
		// }
		// solver.solve();
	}
} Main public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		// for (; solver.hasNextN();) {
		// solver.readN(in.readLine());
		// }
		// for (; solver.hasNextM();) {
		// solver.readM(in.readLine());
		// }
		// solver.solve();
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		// for (; solver.hasNextN();) {
		// solver.readN(in.readLine());
		// }
		// for (; solver.hasNextM();) {
		// solver.readM(in.readLine());
		// }
		// solver.solve();
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) Solver solver = new Solver(); solver new Solver() solver.init() solver.init solver solver.readHead(in.readLine()) solver.readHead solver in.readLine() in.readLine in String args[] args class Solver {
	public void init() {
	}

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		long N = Long.parseLong(strArr[0]);
		int ans = 0;
		for (long i = N; i > 0; i /= 10) {
			ans++;
		}
		for (long d = 1; d * d <= N; d++) {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		}
		System.out.println(ans);
	}

} Solver public void init() {
	} init {
	} public void readHead(String str) {
		String[] strArr = str.split(" ");
		long N = Long.parseLong(strArr[0]);
		int ans = 0;
		for (long i = N; i > 0; i /= 10) {
			ans++;
		}
		for (long d = 1; d * d <= N; d++) {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		}
		System.out.println(ans);
	} readHead {
		String[] strArr = str.split(" ");
		long N = Long.parseLong(strArr[0]);
		int ans = 0;
		for (long i = N; i > 0; i /= 10) {
			ans++;
		}
		for (long d = 1; d * d <= N; d++) {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		}
		System.out.println(ans);
	} String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " long N = Long.parseLong(strArr[0]); N Long.parseLong(strArr[0]) Long.parseLong Long strArr[0] strArr 0 int ans = 0; ans 0 for (long i = N; i > 0; i /= 10) {
			ans++;
		} long i = N; long i = N; i N i > 0 i 0 i /= 10 i /= 10 i 10 {
			ans++;
		} {
			ans++;
		} ans++ ans for (long d = 1; d * d <= N; d++) {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		} long d = 1; long d = 1; d 1 d * d <= N d * d d d N d++ d++ d {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		} {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		} if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			} N % d == 0 N % d N d 0 {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			} if (N / d < d)
					break; N / d < d N / d N d d break; int dig = 0; dig 0 for (long i = N / d; i > 0; i /= 10) {
					dig++;
				} long i = N / d; long i = N / d; i N / d N d i > 0 i 0 i /= 10 i /= 10 i 10 {
					dig++;
				} {
					dig++;
				} dig++ dig if (ans > dig)
					ans = dig; ans > dig ans dig ans = dig ans dig System.out.println(ans) System.out.println System.out System System.out ans String str str
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String args[]) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Solver solver = new Solver();
		solver.init();
		solver.readHead(in.readLine());
		// for (; solver.hasNextN();) {
		// solver.readN(in.readLine());
		// }
		// for (; solver.hasNextM();) {
		// solver.readM(in.readLine());
		// }
		// solver.solve();
	}
}

class Solver {
	public void init() {
	}

	public void readHead(String str) {
		String[] strArr = str.split(" ");
		long N = Long.parseLong(strArr[0]);
		int ans = 0;
		for (long i = N; i > 0; i /= 10) {
			ans++;
		}
		for (long d = 1; d * d <= N; d++) {
			if (N % d == 0) {
				// System.out.println(d);
				if (N / d < d)
					break;
				int dig = 0;
				for (long i = N / d; i > 0; i /= 10) {
					dig++;
				}
				if (ans > dig)
					ans = dig;
			}
		}
		System.out.println(ans);
	}

}
