import java.util.*;

public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  }
  
  public static int F(long a, long b) {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  }
} import java.util.*; util.* java public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  }
  
  public static int F(long a, long b) {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  }
} Main public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  } main {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = Long.parseLong(sc.next()); N Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long j =1 j 1 min =N min N x =N; x N for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,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) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    } {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    } if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      } N % i == 0 N % i N i 0 {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      } j = N / i j N / i N i x = F(i,j) x F(i,j) F i j min = Math.min(x,min) min Math.min(x,min) Math.min Math x min System.out.println(min) System.out.println System.out System System.out min String[] args args public static int F(long a, long b) {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  } F {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  } String aa = String.valueOf(a); aa String.valueOf(a) String.valueOf String a String bb = String.valueOf(b); bb String.valueOf(b) String.valueOf String b return Math.max(aa.length(),bb.length()); Math.max(aa.length(),bb.length()) Math.max Math aa.length() aa.length aa bb.length() bb.length bb long a a long b b public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  }
  
  public static int F(long a, long b) {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  }
} public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  }
  
  public static int F(long a, long b) {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  }
} Main
import java.util.*;

public class Main {
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = Long.parseLong(sc.next());
    long j =1, min =N, x =N;
    for (long i =1; i<=Math.sqrt(N); i++) {
      if (N % i == 0) {
        j = N / i;
        x = F(i,j);
        min = Math.min(x,min);
      }
    }
    System.out.println(min);
  }
  
  public static int F(long a, long b) {
    String aa = String.valueOf(a);
    String bb = String.valueOf(b);
    return Math.max(aa.length(),bb.length());
  }
}