import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		System.out.println(ans);
	}
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		System.out.println(ans);
	}
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		System.out.println(ans);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		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 sc.close() sc.close sc long ans = 100; ans 100 for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		} long i=1; long i=1; i 1 i<Math.sqrt(N)+1 i Math.sqrt(N)+1 Math.sqrt(N) Math.sqrt Math N 1 i++ i++ i {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		} {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		} if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			} N%i==0 N%i N i 0 {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			} int test = Math.max(disit(i, 10), disit(N/i, 10)); test Math.max(disit(i, 10), disit(N/i, 10)) Math.max Math disit(i, 10) disit i 10 disit(N/i, 10) disit N/i N i 10 ans = Math.min(ans, test) ans Math.min(ans, test) Math.min Math ans test System.out.println(ans) System.out.println System.out System System.out ans String[] args args static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	} disit {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	} int count = 0; count 0 while(a!=0) {
			a = a/d;
			count++;
		} a!=0 a 0 {
			a = a/d;
			count++;
		} a = a/d a a/d a d count++ count return count; count long a a long d d static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	} lcm {
		return a*(b/gcd(a, b));
	} return a*(b/gcd(a, b)); a*(b/gcd(a, b)) a (b/gcd(a, b)) b gcd(a, b) gcd a b long a a long b b static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	} gcd {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	} long ta = Math.max(a, b); ta Math.max(a, b) Math.max Math a b long tb = Math.min(a, b); tb Math.min(a, b) Math.min Math a b long tmp; tmp while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		} (tmp = ta%tb) != 0 (tmp = ta%tb) tmp ta%tb ta tb 0 {
			ta = tb;
			tb = tmp;
		} ta = tb ta tb tb = tmp tb tmp return tb; tb long a a long b b static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	} modcomb {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	} if(k==1) {
			return n;
		} k==1 k 1 {
			return n;
		} return n; n long ans = 1; ans 1 for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		} long i=n; long i=n; i n i>=n-k+1 i n-k+1 n-k n k 1 i-- i-- i {
			ans = (ans * i)%mod;
		} {
			ans = (ans * i)%mod;
		} ans = (ans * i)%mod ans (ans * i)%mod (ans * i) ans i mod for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		} long i=k; long i=k; i k 0<i 0 i i-- i-- i {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		} {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		} ans = (ans * modpow(i, mod-2, mod)) % mod ans (ans * modpow(i, mod-2, mod)) % mod (ans * modpow(i, mod-2, mod)) ans modpow(i, mod-2, mod) modpow i mod-2 mod 2 mod mod return ans; ans long n n long k k long mod mod static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	} modpow {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	} if(b==0) return 1; b==0 b 0 return 1; 1 if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		} b%2==0 b%2 b 2 0 {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} long d = modpow(a, b/2, mod); d modpow(a, b/2, mod) modpow a b/2 b 2 mod return (d*d)%mod; (d*d)%mod (d*d) d d mod {
			return (a*modpow(a, b-1, mod))%mod;
		} return (a*modpow(a, b-1, mod))%mod; (a*modpow(a, b-1, mod))%mod (a*modpow(a, b-1, mod)) a modpow(a, b-1, mod) modpow a b-1 b 1 mod mod long a a long b b long mod mod public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		System.out.println(ans);
	}
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		System.out.println(ans);
	}
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		sc.close();
		long ans = 100;
		for(long i=1; i<Math.sqrt(N)+1; i++) {
			if(N%i==0) {
				int test = Math.max(disit(i, 10), disit(N/i, 10));
				ans = Math.min(ans, test);
			}
		}
		System.out.println(ans);
	}
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
}
