import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    }
    private Map<Integer, Integer> primeFactorization(long n) {
        return null;
    }
    private int F(long a, long b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
    private static List<Integer> primeList;
    private static void makePrimeList(int n) {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
} import java.io.*; io.* java import java.math.*; math.* java import java.util.*; util.* java public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    }
    private Map<Integer, Integer> primeFactorization(long n) {
        return null;
    }
    private int F(long a, long b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
    private static List<Integer> primeList;
    private static void makePrimeList(int n) {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
} Main private static boolean debug = false; debug false private static boolean elapsed = false; elapsed false private static PrintWriter _out = new PrintWriter(System.out); _out new PrintWriter(System.out) private static PrintWriter _err = new PrintWriter(System.err); _err new PrintWriter(System.err) private static List<Integer> primeList; primeList private void solve(Scanner sc) {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    } solve {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    } long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        } long A = 1; long A = 1; A 1 A <= Math.sqrt(N) A Math.sqrt(N) Math.sqrt Math N ++A ++A A {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        } {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        } if (N % A != 0) {
                continue;
            } N % A != 0 N % A N A 0 {
                continue;
            } continue; long B = N / A; B N / A N A ans = Math.min(ans, F(A, B)) ans Math.min(ans, F(A, B)) Math.min Math ans F(A, B) F A B _out.println(ans) _out.println _out ans Scanner sc sc private Map<Integer, Integer> primeFactorization(long n) {
        return null;
    } primeFactorization {
        return null;
    } return null; null long n n private int F(long a, long b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    } F {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    } return Math.max(String.valueOf(a).length(), String.valueOf(b).length()); Math.max(String.valueOf(a).length(), String.valueOf(b).length()) Math.max Math String.valueOf(a).length() String.valueOf(a).length String.valueOf(a) String.valueOf String a String.valueOf(b).length() String.valueOf(b).length String.valueOf(b) String.valueOf String b long a a long b b private static void makePrimeList(int n) {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    } makePrimeList {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    } List<Integer> searchList = new ArrayList<>(); searchList new ArrayList<>() for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        } int i = 2; int i = 2; i 2 i <= n i n ++i ++i i {
            searchList.add(i);
        } {
            searchList.add(i);
        } searchList.add(i) searchList.add searchList i primeList = new ArrayList<>(n) primeList new ArrayList<>(n) do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n)); searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n) searchList.size() > 0 searchList.size() searchList.size searchList 0 searchList.get(0) <= Math.sqrt(n) searchList.get(0) searchList.get searchList 0 Math.sqrt(n) Math.sqrt Math n {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } int prime = searchList.remove(0); prime searchList.remove(0) searchList.remove searchList 0 primeList.add(prime) primeList.add primeList prime int i = 2; i 2 while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            } prime * i <= n prime * i prime i n {
                searchList.remove((Integer)(prime * i));
                ++i;
            } searchList.remove((Integer)(prime * i)) searchList.remove searchList (Integer)(prime * i) prime i ++i i primeList.addAll(searchList) primeList.addAll primeList searchList int n n private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    } C {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    } BigInteger res = BigInteger.ONE; res BigInteger.ONE BigInteger BigInteger.ONE for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        } long i = n; long i = n; i n i > n - r i n - r n r --i --i i {
            res = res.multiply(BigInteger.valueOf(i));
        } {
            res = res.multiply(BigInteger.valueOf(i));
        } res = res.multiply(BigInteger.valueOf(i)) res res.multiply(BigInteger.valueOf(i)) res.multiply res BigInteger.valueOf(i) BigInteger.valueOf BigInteger i for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        } long i = r; long i = r; i r i > 1 i 1 --i --i i {
            res = res.divide(BigInteger.valueOf(i));
        } {
            res = res.divide(BigInteger.valueOf(i));
        } res = res.divide(BigInteger.valueOf(i)) res res.divide(BigInteger.valueOf(i)) res.divide res BigInteger.valueOf(i) BigInteger.valueOf BigInteger i return res; res long n n long r r private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    } P {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    } BigInteger res = BigInteger.ONE; res BigInteger.ONE BigInteger BigInteger.ONE for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        } long i = n; long i = n; i n i > n - r i n - r n r --i --i i {
            res = res.multiply(BigInteger.valueOf(i));
        } {
            res = res.multiply(BigInteger.valueOf(i));
        } res = res.multiply(BigInteger.valueOf(i)) res res.multiply(BigInteger.valueOf(i)) res.multiply res BigInteger.valueOf(i) BigInteger.valueOf BigInteger i return res; res long n n long r r /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    } main {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    } long S = System.currentTimeMillis(); S System.currentTimeMillis() System.currentTimeMillis System Scanner sc = new Scanner(System.in); sc new Scanner(System.in) new Main().solve(sc) new Main().solve new Main() sc _out.flush() _out.flush _out long G = System.currentTimeMillis(); G System.currentTimeMillis() System.currentTimeMillis System if (elapsed) {
            _err.println((G - S) + "ms");
        } elapsed {
            _err.println((G - S) + "ms");
        } _err.println((G - S) + "ms") _err.println _err (G - S) + "ms" (G - S) G S "ms" _err.flush() _err.flush _err String[] args args public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    }
    private Map<Integer, Integer> primeFactorization(long n) {
        return null;
    }
    private int F(long a, long b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
    private static List<Integer> primeList;
    private static void makePrimeList(int n) {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
} public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    }
    private Map<Integer, Integer> primeFactorization(long n) {
        return null;
    }
    private int F(long a, long b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
    private static List<Integer> primeList;
    private static void makePrimeList(int n) {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
} Main
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        long N = sc.nextLong();

        int ans = Integer.MAX_VALUE;
        for (long A = 1; A <= Math.sqrt(N); ++A) {
            if (N % A != 0) {
                continue;
            }
            long B = N / A;
            ans = Math.min(ans, F(A, B));
        }
        _out.println(ans);
    }
    private Map<Integer, Integer> primeFactorization(long n) {
        return null;
    }
    private int F(long a, long b) {
        return Math.max(String.valueOf(a).length(), String.valueOf(b).length());
    }
    private static List<Integer> primeList;
    private static void makePrimeList(int n) {
        List<Integer> searchList = new ArrayList<>();
        for (int i = 2; i <= n; ++i) {
            searchList.add(i);
        }
        primeList = new ArrayList<>(n);

        do {
            int prime = searchList.remove(0);
            primeList.add(prime);
            int i = 2;
            while (prime * i <= n) {
                searchList.remove((Integer)(prime * i));
                ++i;
            }
        } while (searchList.size() > 0 && searchList.get(0) <= Math.sqrt(n));
        primeList.addAll(searchList);
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}