import java.io.*;
import java.util.*;
public class Main {
    private static MyScanner scanner;
 
    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }
 
    private void solve() {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    private int solveF (long a, long b) {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    }
 
    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
 
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }
 
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }
 
        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
 
        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    private static MyScanner scanner;
 
    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }
 
    private void solve() {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    private int solveF (long a, long b) {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    }
 
    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
 
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }
 
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }
 
        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
 
        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
} Main private static MyScanner scanner; scanner public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    } main {
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    } Main instance = new Main(); instance new Main() scanner = instance.new MyScanner() scanner instance.new MyScanner() instance instance instance.solve() instance.solve instance String[] args args private void solve() {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    } solve {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    } try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } long N = scanner.nextLong(); N scanner.nextLong() scanner.nextLong scanner long A = 1; A 1 long B = N; B N long min = solveF(A, B); min solveF(A, B) solveF A B for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            } long i = 2; long i = 2; i 2 i <= Math.sqrt(N) i Math.sqrt(N) Math.sqrt Math N i++ i++ i {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            } {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            } if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                } N % i == 0 N % i N i 0 {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                } int f = solveF(i, N / i); f solveF(i, N / i) solveF i N / i N i if (f < min) {
                        min = f;
                    } f < min f min {
                        min = f;
                    } min = f min f System.out.println(min) System.out.println System.out System System.out min private int solveF (long a, long b) {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    } solveF {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    } return a > b ? String.valueOf(a).length() : String.valueOf(b).length(); a > b ? String.valueOf(a).length() : String.valueOf(b).length() a > b a b String.valueOf(a).length() String.valueOf(a).length String.valueOf(a) String.valueOf String a String.valueOf(b).length() String.valueOf(b).length String.valueOf(b) String.valueOf String b long a a long b b private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
 
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }
 
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }
 
        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
 
        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    } MyScanner String[] s; s int i; i BufferedReader br; br String reg = " "; reg " " MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        } MyScanner {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        } s = new String[0] s new String[0] 0 i = 0 i 0 br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        } next {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        } if (i < s.length) return s[i++]; i < s.length i s.length s s.length return s[i++]; s[i++] s i++ i String line = br.readLine(); line br.readLine() br.readLine br while (line.equals("")) {
                line = br.readLine();
            } line.equals("") line.equals line "" {
                line = br.readLine();
            } line = br.readLine() line br.readLine() br.readLine br s = line.split(reg, 0) s line.split(reg, 0) line.split line reg 0 i = 0 i 0 return s[i++]; s[i++] s i++ i public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {
    private static MyScanner scanner;
 
    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }
 
    private void solve() {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    private int solveF (long a, long b) {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    }
 
    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
 
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }
 
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }
 
        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
 
        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
} public class Main {
    private static MyScanner scanner;
 
    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }
 
    private void solve() {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    private int solveF (long a, long b) {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    }
 
    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
 
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }
 
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }
 
        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
 
        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    private static MyScanner scanner;
 
    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }
 
    private void solve() {
        try {
            long N = scanner.nextLong();
            long A = 1;
            long B = N;
            long min = solveF(A, B);
            for (long i = 2; i <= Math.sqrt(N); i++) {
                if (N % i == 0) {
                    int f = solveF(i, N / i);
                    if (f < min) {
                        min = f;
                    }
                }
            }
            System.out.println(min);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    private int solveF (long a, long b) {
        return a > b ? String.valueOf(a).length() : String.valueOf(b).length();
    }
 
    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
 
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }
 
        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }
 
        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
 
        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
}