import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class DigitMultiplication {
        int f(long a) {
            return Long.toString(a).length();
        }

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.HashSet; HashSet java.util import java.util.StringTokenizer; StringTokenizer java.util import java.util.Set; Set java.util import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class DigitMultiplication {
        int f(long a) {
            return Long.toString(a).length();
        }

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out FastReader in = new FastReader(inputStream); in new FastReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) DigitMultiplication solver = new DigitMultiplication(); solver new DigitMultiplication() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class DigitMultiplication {
        int f(long a) {
            return Long.toString(a).length();
        }

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        }

    } DigitMultiplication int f(long a) {
            return Long.toString(a).length();
        } f {
            return Long.toString(a).length();
        } return Long.toString(a).length(); Long.toString(a).length() Long.toString(a).length Long.toString(a) Long.toString Long a long a a public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        } solve {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        } long n = in.nextLong(); n in.nextLong() in.nextLong in Set<Long> divisors = new HashSet<>(); divisors new HashSet<>() long ans = 9999999999L; ans 9999999999L for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            } long i = 1; long i = 1; i 1 i * i <= n i * i i i n i++ i++ i {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            } {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            } if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                } n % i == 0 n % i n i 0 {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                } if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    } i != n / i i n / i n i {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } ans = Math.min(Math.max(f(i), f(n / i)), ans) ans Math.min(Math.max(f(i), f(n / i)), ans) Math.min Math Math.max(f(i), f(n / i)) Math.max Math f(i) f i f(n / i) f n / i n i ans {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    } ans = Math.min(Math.max(f(i), f(i)), ans) ans Math.min(Math.max(f(i), f(i)), ans) Math.min Math Math.max(f(i), f(i)) Math.max Math f(i) f i f(i) f i ans out.println(ans) out.println out ans int testNumber testNumber FastReader in in PrintWriter out out static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    } FastReader BufferedReader reader; reader StringTokenizer st; st public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        } FastReader {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        } reader = new BufferedReader(new InputStreamReader(stream)) reader new BufferedReader(new InputStreamReader(stream)) st = null st null InputStream stream stream public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            } try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                } catch (Exception e) {
                    throw new RuntimeException();
                } Exception e {
                    throw new RuntimeException();
                } throw new RuntimeException(); new RuntimeException() {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } String line = reader.readLine(); line reader.readLine() reader.readLine reader if (line == null) {
                        return null;
                    } line == null line null {
                        return null;
                    } return null; null st = new StringTokenizer(line) st new StringTokenizer(line) return st.nextToken(); st.nextToken() st.nextToken st public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class DigitMultiplication {
        int f(long a) {
            return Long.toString(a).length();
        }

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class DigitMultiplication {
        int f(long a) {
            return Long.toString(a).length();
        }

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.Set;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitMultiplication solver = new DigitMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class DigitMultiplication {
        int f(long a) {
            return Long.toString(a).length();
        }

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            long n = in.nextLong();
            Set<Long> divisors = new HashSet<>();
            long ans = 9999999999L;
            for (long i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                    if (i != n / i) {
                        ans = Math.min(Math.max(f(i), f(n / i)), ans);
                    } else {
                        ans = Math.min(Math.max(f(i), f(i)), ans);
                    }
                }
            }
            out.println(ans);
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

