import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		System.out.println(ans);
	}

	public static int kouta(long i, long j) {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		System.out.println(ans);
	}

	public static int kouta(long i, long j) {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		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 int ans = 100100; ans 100100 for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		} long i = 1 ; long i = 1 ; i 1 i * i <= n i * i i i n i++ i++ i {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		} {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		} if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			} n % i == 0 n % i n i 0 {
				ans = Math.min(ans, kouta(i, n / i));
			} ans = Math.min(ans, kouta(i, n / i)) ans Math.min(ans, kouta(i, n / i)) Math.min Math ans kouta(i, n / i) kouta i n / i n i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int kouta(long i, long j) {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	} kouta {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	} int ret = 0; ret 0 if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		} i >= j i j {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} while(i > 0) {
				ret++;
				i /= 10;
			} i > 0 i 0 {
				ret++;
				i /= 10;
			} ret++ ret i /= 10 i 10 {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		} while(j > 0) {
				ret++;
				j /= 10;
			} j > 0 j 0 {
				ret++;
				j /= 10;
			} ret++ ret j /= 10 j 10 return ret; ret long i i long j j public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		System.out.println(ans);
	}

	public static int kouta(long i, long j) {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		System.out.println(ans);
	}

	public static int kouta(long i, long j) {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int ans = 100100;
		for(long i = 1 ; i * i <= n ; i++) {
			if(n % i == 0) {
				ans = Math.min(ans, kouta(i, n / i));
			}
		}
		System.out.println(ans);
	}

	public static int kouta(long i, long j) {
		int ret = 0;
		if(i >= j) {
			while(i > 0) {
				ret++;
				i /= 10;
			}
		} else {
			while(j > 0) {
				ret++;
				j /= 10;
			}
		}
		return ret;
	}

}
