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

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

class ABC057CCSolve {
	
	long N;
	
	ABC057CCSolve() {
		Scanner cin = new Scanner(System.in);
		this.N = cin.nextLong();
	}
	
	void main() {
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(N); i++) {
			if (N % i != 0) continue;
						
			long a = i;
			long b = N / a;
			min = Math.min(min, F(a, b));
		}
		System.out.println(min);
	}
	
	int F(long A, long B) {
		return Math.min(String.valueOf(B).length(), String.valueOf(B).length());
	}
	
}
