import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    } main {
        Main main = new Main();
        main.solve();
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) long N = scan.nextLong(); N scan.nextLong() scan.nextLong scan List<Long> list = new ArrayList<>(); list new ArrayList<>() for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        } long i = 1; long i = 1; i 1 i * i <= N i * i i i N i++ i++ i {
            if (N % i == 0) {
                list.add(i);
            }
        } {
            if (N % i == 0) {
                list.add(i);
            }
        } if (N % i == 0) {
                list.add(i);
            } N % i == 0 N % i N i 0 {
                list.add(i);
            } list.add(i) list.add list i long answer = String.valueOf(N).length(); answer String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        } long x list {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        } {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        } long y = N / x; y N / x N x answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length())) answer Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length())) Math.min Math answer Math.max(String.valueOf(x).length(), String.valueOf(y).length()) Math.max Math String.valueOf(x).length() String.valueOf(x).length String.valueOf(x) String.valueOf String x String.valueOf(y).length() String.valueOf(y).length String.valueOf(y) String.valueOf String y System.out.println(answer) System.out.println System.out System System.out answer public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long N = scan.nextLong();
        List<Long> list = new ArrayList<>();
        for(long i = 1; i * i <= N; i++) {
            if (N % i == 0) {
                list.add(i);
            }
        }
        long answer = String.valueOf(N).length();
        for (long x : list) {
            long y = N / x;
            answer = Math.min(answer, Math.max(String.valueOf(x).length(), String.valueOf(y).length()));
        }
        System.out.println(answer);
    }
}
