import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	}
	
	static int function(long a, long b) {
	    return Math.max(getCount(a), getCount(b));
	}
	
	static int getCount(long x) {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	}
	
	static int function(long a, long b) {
	    return Math.max(getCount(a), getCount(b));
	}
	
	static int getCount(long x) {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc 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) {
		        min = Math.min(min, function(i, n / i));
		    }
		} 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) {
		        min = Math.min(min, function(i, n / i));
		    }
		} {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		} if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    } n % i == 0 n % i n i 0 {
		        min = Math.min(min, function(i, n / i));
		    } min = Math.min(min, function(i, n / i)) min Math.min(min, function(i, n / i)) Math.min Math min function(i, n / i) function i n / i n i System.out.println(min) System.out.println System.out System System.out min String[] args args static int function(long a, long b) {
	    return Math.max(getCount(a), getCount(b));
	} function {
	    return Math.max(getCount(a), getCount(b));
	} return Math.max(getCount(a), getCount(b)); Math.max(getCount(a), getCount(b)) Math.max Math getCount(a) getCount a getCount(b) getCount b long a a long b b static int getCount(long x) {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	} getCount {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	} int ans = 0; ans 0 while (x > 0) {
	        ans++;
	        x /= 10;
	    } x > 0 x 0 {
	        ans++;
	        x /= 10;
	    } ans++ ans x /= 10 x 10 return ans; ans long x x public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	}
	
	static int function(long a, long b) {
	    return Math.max(getCount(a), getCount(b));
	}
	
	static int getCount(long x) {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	}
	
	static int function(long a, long b) {
	    return Math.max(getCount(a), getCount(b));
	}
	
	static int getCount(long x) {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	}
} Main
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		int min = Integer.MAX_VALUE;
		for (int i = 1; i <= Math.sqrt(n); i++) {
		    if (n % i == 0) {
		        min = Math.min(min, function(i, n / i));
		    }
		}
		System.out.println(min);
	}
	
	static int function(long a, long b) {
	    return Math.max(getCount(a), getCount(b));
	}
	
	static int getCount(long x) {
	    int ans = 0;
	    while (x > 0) {
	        ans++;
	        x /= 10;
	    }
	    return ans;
	}
}
