
import java.util.Scanner;

public class Main {
    public static int g(long x) {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static int g(long x) {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    }
} Main public static int g(long x) {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    } g {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    } int res = 0; res 0 while (x > 0) {
            ++res;
            x /= 10;
        } x > 0 x 0 {
            ++res;
            x /= 10;
        } ++res res x /= 10 x 10 return res; res long x x public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    } main {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int res = Integer.MAX_VALUE; res Integer.MAX_VALUE Integer Integer.MAX_VALUE for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        } long i = 1; long i = 1; i 1 i * i <= N i * i i i N ++i ++i i {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        } {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        } if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            } N % i == 0 N % i N i 0 {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            } long a = N / i; a N / i N i res = Math.min(res, Math.max(g(i), g(a))) res Math.min(res, Math.max(g(i), g(a))) Math.min Math res Math.max(g(i), g(a)) Math.max Math g(i) g i g(a) g a System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
    public static int g(long x) {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    }
} public class Main {
    public static int g(long x) {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    }
} Main

import java.util.Scanner;

public class Main {
    public static int g(long x) {
        int res = 0;
        while (x > 0) {
            ++res;
            x /= 10;
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        int res = Integer.MAX_VALUE;
        for (long i = 1; i * i <= N; ++i) {
            if (N % i == 0) {
                long a = N / i;
                res = Math.min(res, Math.max(g(i), g(a)));
            }
        }
        System.out.println(res);
    }
}