import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int M = (int)  Math.sqrt( N ) + 1; M (int)  Math.sqrt( N ) + 1 (int)  Math.sqrt( N ) Math.sqrt Math N 1 int Fmin = String.valueOf(N).length(); Fmin String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    } int i = 2 ; int i = 2 ; i 2 i <= M i M i ++ i ++ i {
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    } {
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    } if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      } N % i == 0 N % i N i 0 {
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      } long j = N / i ; j N / i N i int A = String.valueOf(i).length(); A String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i int B = String.valueOf(j).length(); B String.valueOf(j).length() String.valueOf(j).length String.valueOf(j) String.valueOf String j int F = Math.max(A,B); F Math.max(A,B) Math.max Math A B if(Fmin > F){
          Fmin = F ;
        } Fmin > F Fmin F {
          Fmin = F ;
        } Fmin = F Fmin F System.out.println(Fmin) System.out.println System.out System System.out Fmin String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int M = (int)  Math.sqrt( N ) + 1;

    int Fmin = String.valueOf(N).length();
    for(int i = 2 ; i <= M ; i ++){
      if( N % i == 0 ){
        long j = N / i ;
        int A = String.valueOf(i).length();
        int B = String.valueOf(j).length();
        int F = Math.max(A,B);
        if(Fmin > F){
          Fmin = F ;
        }
      }
    }
    System.out.println(Fmin);
  }
}
