import java.util.ArrayList;
import java.util.Scanner;




class Main{


	static	ArrayList<Integer> one ;
	static	ArrayList<Integer> two ;
	static	ArrayList<Integer> three ;
	static	ArrayList<Integer> four ;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);			//文字の入力
		long n = sc.nextLong();

		long ans = n;
		for(long i = 1; i*i <= n;i++){
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		}
		System.out.println(ans);



	}
}

class Pair implements Comparable{
	Character from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}

 import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util class Main{


	static	ArrayList<Integer> one ;
	static	ArrayList<Integer> two ;
	static	ArrayList<Integer> three ;
	static	ArrayList<Integer> four ;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);			//文字の入力
		long n = sc.nextLong();

		long ans = n;
		for(long i = 1; i*i <= n;i++){
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		}
		System.out.println(ans);



	}
} Main static	ArrayList<Integer> one ; one static	ArrayList<Integer> two ; two static	ArrayList<Integer> three ; three static	ArrayList<Integer> four ; four public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);			//文字の入力
		long n = sc.nextLong();

		long ans = n;
		for(long i = 1; i*i <= n;i++){
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		}
		System.out.println(ans);



	} main {

		Scanner sc = new Scanner(System.in);			//文字の入力
		long n = sc.nextLong();

		long ans = n;
		for(long i = 1; i*i <= n;i++){
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		}
		System.out.println(ans);



	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long ans = n; ans n for(long i = 1; i*i <= n;i++){
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		} long i = 1; long i = 1; i 1 i*i <= n i*i i i n i++ i++ i {
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		} {
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		} if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			} n % i == 0 n % i n i 0 {
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			} long mm = Math.max(i, n/i); mm Math.max(i, n/i) Math.max Math i n/i n i long keta = String.valueOf(mm).length(); keta String.valueOf(mm).length() String.valueOf(mm).length String.valueOf(mm) String.valueOf String mm ans = Math.min(ans, keta) ans Math.min(ans, keta) Math.min Math ans keta System.out.println(ans) System.out.println System.out System System.out ans String[] args args class Pair implements Comparable{
	Character from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
} Pair Character from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} compareTo {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return end - otherpair.end; end - otherpair.end end otherpair.end otherpair otherpair.end Object other other Comparable
import java.util.ArrayList;
import java.util.Scanner;




class Main{


	static	ArrayList<Integer> one ;
	static	ArrayList<Integer> two ;
	static	ArrayList<Integer> three ;
	static	ArrayList<Integer> four ;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);			//文字の入力
		long n = sc.nextLong();

		long ans = n;
		for(long i = 1; i*i <= n;i++){
			if(n % i == 0){
				long mm = Math.max(i, n/i);
				long keta = String.valueOf(mm).length();
				ans = Math.min(ans, keta);
			}
		}
		System.out.println(ans);



	}
}

class Pair implements Comparable{
	Character from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}


