
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    }

    public static int calc(long i, long j) {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    }
} import java.util.ArrayList; ArrayList java.util 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();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    }

    public static int calc(long i, long j) {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc sc.close() sc.close sc int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        } long i = 1; long i = 1; i 1 i <= Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        } {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        } if (n % i != 0)
                continue; n % i != 0 n % i n i 0 continue; long j = n / i; j n / i n i min = Math.min(calc(i, j), min) min Math.min(calc(i, j), min) Math.min Math calc(i, j) calc i j min System.out.println(min) System.out.println System.out System System.out min String[] args args public static int calc(long i, long j) {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    } calc {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    } int digitI = Long.toString(i).length(); digitI Long.toString(i).length() Long.toString(i).length Long.toString(i) Long.toString Long i int digitJ = Long.toString(j).length(); digitJ Long.toString(j).length() Long.toString(j).length Long.toString(j) Long.toString Long j return Math.max(digitI, digitJ); Math.max(digitI, digitJ) Math.max Math digitI digitJ long i i long j j public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    }

    public static int calc(long i, long j) {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    }

    public static int calc(long i, long j) {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    }
} Main

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        sc.close();
        int min = Integer.MAX_VALUE;
        for (long i = 1; i <= Math.sqrt(n); i++) {
            if (n % i != 0)
                continue;
            long j = n / i;
            min = Math.min(calc(i, j), min);
        }
        System.out.println(min);
    }

    public static int calc(long i, long j) {
        int digitI = Long.toString(i).length();
        int digitJ = Long.toString(j).length();
        return Math.max(digitI, digitJ);
    }
}
