import java.util.Scanner;

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

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    }

    static int solve(long N) {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    }

    static int computeDigitNum(long x) {
        return String.valueOf(x).length();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    }

    static int solve(long N) {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    }

    static int computeDigitNum(long x) {
        return String.valueOf(x).length();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc System.out.println(solve(N)) System.out.println System.out System System.out solve(N) solve N sc.close() sc.close sc String[] args args static int solve(long N) {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    } solve {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    } int result = Integer.MAX_VALUE; result Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        } int i = 1; int i = 1; i 1 (long) i * i <= N (long) i * i (long) i i N ++i ++i i {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        } {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        } if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            } N % i == 0 N % i N i 0 {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            } result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i))) result Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i))) Math.min Math result Math.max(computeDigitNum(i), computeDigitNum(N / i)) Math.max Math computeDigitNum(i) computeDigitNum i computeDigitNum(N / i) computeDigitNum N / i N i return result; result long N N static int computeDigitNum(long x) {
        return String.valueOf(x).length();
    } computeDigitNum {
        return String.valueOf(x).length();
    } return String.valueOf(x).length(); String.valueOf(x).length() String.valueOf(x).length String.valueOf(x) String.valueOf String x long x x public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    }

    static int solve(long N) {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    }

    static int computeDigitNum(long x) {
        return String.valueOf(x).length();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    }

    static int solve(long N) {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    }

    static int computeDigitNum(long x) {
        return String.valueOf(x).length();
    }
} Main
import java.util.Scanner;

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

        long N = sc.nextLong();

        System.out.println(solve(N));

        sc.close();
    }

    static int solve(long N) {
        int result = Integer.MAX_VALUE;
        for (int i = 1; (long) i * i <= N; ++i) {
            if (N % i == 0) {
                result = Math.min(result, Math.max(computeDigitNum(i), computeDigitNum(N / i)));
            }
        }

        return result;
    }

    static int computeDigitNum(long x) {
        return String.valueOf(x).length();
    }
}