import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	}
}

class ABC057CSolve {
	
	long N;
	
	ABC057CSolve() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextLong();
	}
	
	void main() {
		long min = Long.MAX_VALUE / 2;
		if (N == 1) {
			System.out.println(1);
			return;
		}
		for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		}
		System.out.println(min);
	}
	
	int F(long a, long b) {
		int aCount = String.valueOf(a).length();
		int bCount = String.valueOf(b).length();
		return aCount > bCount ? aCount : bCount;
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	}
} Main public static void main(String[] args) {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	} main {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	} ABC057CSolve solve = new ABC057CSolve(); solve new ABC057CSolve() solve.main() solve.main solve String[] args args class ABC057CSolve {
	
	long N;
	
	ABC057CSolve() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextLong();
	}
	
	void main() {
		long min = Long.MAX_VALUE / 2;
		if (N == 1) {
			System.out.println(1);
			return;
		}
		for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		}
		System.out.println(min);
	}
	
	int F(long a, long b) {
		int aCount = String.valueOf(a).length();
		int bCount = String.valueOf(b).length();
		return aCount > bCount ? aCount : bCount;
	}

} ABC057CSolve long N; N ABC057CSolve() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextLong();
	} ABC057CSolve {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextLong();
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) this.N = cin.nextLong() this.N this this.N cin.nextLong() cin.nextLong cin void main() {
		long min = Long.MAX_VALUE / 2;
		if (N == 1) {
			System.out.println(1);
			return;
		}
		for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		}
		System.out.println(min);
	} main {
		long min = Long.MAX_VALUE / 2;
		if (N == 1) {
			System.out.println(1);
			return;
		}
		for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		}
		System.out.println(min);
	} long min = Long.MAX_VALUE / 2; min Long.MAX_VALUE / 2 Long.MAX_VALUE Long Long.MAX_VALUE 2 if (N == 1) {
			System.out.println(1);
			return;
		} N == 1 N 1 {
			System.out.println(1);
			return;
		} System.out.println(1) System.out.println System.out System System.out 1 return; for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		} 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) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		} {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		} if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			} N % i == 0 N % i N i 0 {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			} long a = i; a i long b = N / i; b N / i N i long f = F(a, b); f F(a, b) F a b min = Math.min(min, f) min Math.min(min, f) Math.min Math min f System.out.println(min) System.out.println System.out System System.out min int F(long a, long b) {
		int aCount = String.valueOf(a).length();
		int bCount = String.valueOf(b).length();
		return aCount > bCount ? aCount : bCount;
	} F {
		int aCount = String.valueOf(a).length();
		int bCount = String.valueOf(b).length();
		return aCount > bCount ? aCount : bCount;
	} int aCount = String.valueOf(a).length(); aCount String.valueOf(a).length() String.valueOf(a).length String.valueOf(a) String.valueOf String a int bCount = String.valueOf(b).length(); bCount String.valueOf(b).length() String.valueOf(b).length String.valueOf(b) String.valueOf String b return aCount > bCount ? aCount : bCount; aCount > bCount ? aCount : bCount aCount > bCount aCount bCount aCount bCount long a a long b b public class Main {
	public static void main(String[] args) {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	}
} public class Main {
	public static void main(String[] args) {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		ABC057CSolve solve = new ABC057CSolve();
		solve.main();
	}
}

class ABC057CSolve {
	
	long N;
	
	ABC057CSolve() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextLong();
	}
	
	void main() {
		long min = Long.MAX_VALUE / 2;
		if (N == 1) {
			System.out.println(1);
			return;
		}
		for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i == 0) {
				long a = i;
				long b = N / i;
				long f = F(a, b);
				min = Math.min(min, f);
			}
		}
		System.out.println(min);
	}
	
	int F(long a, long b) {
		int aCount = String.valueOf(a).length();
		int bCount = String.valueOf(b).length();
		return aCount > bCount ? aCount : bCount;
	}

}
