import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    }

    static int digits(long n) {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    }

    static int digits(long n) {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    } main {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) long n = in.nextLong(); n in.nextLong() in.nextLong in int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        } int p = 1; int p = 1; p 1 p < Math.sqrt(n) + 1 p Math.sqrt(n) + 1 Math.sqrt(n) Math.sqrt Math n 1 p++ p++ p {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        } {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        } if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            } n % p == 0 n % p n p 0 {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            } long q = n / p; q n / p n p int f = Math.max(digits(p), digits(q)); f Math.max(digits(p), digits(q)) Math.max Math digits(p) digits p digits(q) digits q min = Math.min(min, f) min Math.min(min, f) Math.min Math min f System.out.println(min) System.out.println System.out System System.out min String[] args args static int digits(long n) {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    } digits {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    } int count = 0; count 0 while (n > 0) {
            count++;
            n /= 10;
        } n > 0 n 0 {
            count++;
            n /= 10;
        } count++ count n /= 10 n 10 return count; count long n n public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    }

    static int digits(long n) {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    }

    static int digits(long n) {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();

        int min = Integer.MAX_VALUE;
        for (int p = 1; p < Math.sqrt(n) + 1; p++) {
            if (n % p == 0) {
                long q = n / p;

                int f = Math.max(digits(p), digits(q));
                min = Math.min(min, f);
            }
        }

        System.out.println(min);
    }

    static int digits(long n) {
        int count = 0;
        while (n > 0) {
            count++;
            n /= 10;
        }
        return count;
    }
}
