
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	}

	private long keta(long x) {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	}


}

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

	public void run() {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	}

	private long keta(long x) {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	}


} Main public static void main(String[] args) {
		Main main = new Main();
		main.run();
	} main {
		Main main = new Main();
		main.run();
	} Main main = new Main(); main new Main() main.run() main.run main String[] args args public void run() {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	} run {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n=sc.nextLong(); n sc.nextLong() sc.nextLong sc long ans=keta(n); ans keta(n) keta n for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		} long i=2; long i=2; i 2 i*i<=n i*i i i n i++ i++ i {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		} {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		} if(n%i!=0) continue; n%i!=0 n%i n i 0 continue; long k = Math.max(keta(i), keta(n/i)); k Math.max(keta(i), keta(n/i)) Math.max Math keta(i) keta i keta(n/i) keta n/i n i if(ans>k) {
				ans = k;
			} ans>k ans k {
				ans = k;
			} ans = k ans k System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc private long keta(long x) {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	} keta {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	} if((x/10)==0) {
			return 1;
		} (x/10)==0 (x/10) x 10 0 {
			return 1;
		} return 1; 1 return keta(x/10)+1; keta(x/10)+1 keta(x/10) keta x/10 x 10 1 long x x public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	}

	private long keta(long x) {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	}


} public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	}

	private long keta(long x) {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	}


} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long ans=keta(n);
		for(long i=2; i*i<=n; i++) {
			if(n%i!=0) continue;
			long k = Math.max(keta(i), keta(n/i));
			if(ans>k) {
				ans = k;
			}
		}
		System.out.println(ans);
		sc.close();
	}

	private long keta(long x) {
		if((x/10)==0) {
			return 1;
		}
		return keta(x/10)+1;
	}


}


