import java.util.Scanner;

class Main {
	long n;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		n = sc.nextLong();
	}

	void solve() {
		int root = (int)Math.pow(n, 0.5);
		long a,b;
		int min = Integer.MAX_VALUE;
		for(int i=1;i<=root;i++){
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		}
		System.out.println(min);
	}
	int f(long a,long b){
		if(a>b){
			return String.valueOf(a).length();
		} else {
			return String.valueOf(b).length();
		}
	}
} import java.util.Scanner; Scanner java.util class Main {
	long n;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		n = sc.nextLong();
	}

	void solve() {
		int root = (int)Math.pow(n, 0.5);
		long a,b;
		int min = Integer.MAX_VALUE;
		for(int i=1;i<=root;i++){
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		}
		System.out.println(min);
	}
	int f(long a,long b){
		if(a>b){
			return String.valueOf(a).length();
		} else {
			return String.valueOf(b).length();
		}
	}
} Main long n; n public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Main m = new Main(sc); m new Main(sc) m.solve() m.solve m sc.close() sc.close sc String[] args args Main(Scanner sc) {
		n = sc.nextLong();
	} Main {
		n = sc.nextLong();
	} n = sc.nextLong() n sc.nextLong() sc.nextLong sc Scanner sc sc void solve() {
		int root = (int)Math.pow(n, 0.5);
		long a,b;
		int min = Integer.MAX_VALUE;
		for(int i=1;i<=root;i++){
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		}
		System.out.println(min);
	} solve {
		int root = (int)Math.pow(n, 0.5);
		long a,b;
		int min = Integer.MAX_VALUE;
		for(int i=1;i<=root;i++){
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		}
		System.out.println(min);
	} int root = (int)Math.pow(n, 0.5); root (int)Math.pow(n, 0.5) Math.pow Math n 0.5 long a a b; b int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for(int i=1;i<=root;i++){
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		} int i=1; int i=1; i 1 i<=root i root i++ i++ i {
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		} {
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		} if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			} n%i==0 n%i n i 0 {
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			} a = i a i b = n / i b n / i n i 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){
		if(a>b){
			return String.valueOf(a).length();
		} else {
			return String.valueOf(b).length();
		}
	} f {
		if(a>b){
			return String.valueOf(a).length();
		} else {
			return String.valueOf(b).length();
		}
	} if(a>b){
			return String.valueOf(a).length();
		} else {
			return String.valueOf(b).length();
		} a>b a b {
			return String.valueOf(a).length();
		} return String.valueOf(a).length(); String.valueOf(a).length() String.valueOf(a).length String.valueOf(a) String.valueOf String a {
			return String.valueOf(b).length();
		} return String.valueOf(b).length(); String.valueOf(b).length() String.valueOf(b).length String.valueOf(b) String.valueOf String b long a a long b b
import java.util.Scanner;

class Main {
	long n;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Main m = new Main(sc);
		m.solve();
		sc.close();
	}

	Main(Scanner sc) {
		n = sc.nextLong();
	}

	void solve() {
		int root = (int)Math.pow(n, 0.5);
		long a,b;
		int min = Integer.MAX_VALUE;
		for(int i=1;i<=root;i++){
			if(n%i==0){
				a = i;b = n / i;
				min = Math.min(min, f(a,b));
			}
		}
		System.out.println(min);
	}
	int f(long a,long b){
		if(a>b){
			return String.valueOf(a).length();
		} else {
			return String.valueOf(b).length();
		}
	}
}