import java.util.*;

class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                }
        }
} import java.util.*; util.* java class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                }
        }
} Main public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                }
        } main {
                try (Scanner sc = new Scanner(System.in)) {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                }
        } try (Scanner sc = new Scanner(System.in)) {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                } {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int ans = 100000; ans 100000 for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        } long i = 1; long i = 1; i 1 i <= Math.sqrt(N) + 1 i Math.sqrt(N) + 1 Math.sqrt(N) Math.sqrt Math N 1 i++ i++ i {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        } {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        } if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                } N % i == 0 N % i N i 0 {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                } long M = N / i; M N / i N i int count = 0; count 0 while (M != 0) {
                                                M /= 10;
                                                count++;
                                        } M != 0 M 0 {
                                                M /= 10;
                                                count++;
                                        } M /= 10 M 10 count++ count ans = Math.min(count, ans) ans Math.min(count, ans) Math.min Math count ans System.out.println(ans) System.out.println System.out System System.out ans String args[] args
import java.util.*;

class Main {
        public static void main(String args[]) {
                try (Scanner sc = new Scanner(System.in)) {
                        long N = sc.nextLong();
                        int ans = 100000;
                        for (long i = 1; i <= Math.sqrt(N) + 1; i++) {
                                if (N % i == 0) {
                                        long M = N / i;
                                        int count = 0;
                                        while (M != 0) {
                                                M /= 10;
                                                count++;
                                        }
                                        ans = Math.min(count, ans);
                                }
                        }
                        System.out.println(ans);
                }
        }
}