import java.util.Scanner;

public class Main{
  static final int INF = Integer.MAX_VALUE / 2;
  static long n;

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  }

  private static int f(long a, long b){
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  }
} import java.util.Scanner; Scanner java.util public class Main{
  static final int INF = Integer.MAX_VALUE / 2;
  static long n;

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  }

  private static int f(long a, long b){
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  }
} Main static final int INF = Integer.MAX_VALUE / 2; INF Integer.MAX_VALUE / 2 Integer.MAX_VALUE Integer Integer.MAX_VALUE 2 static long n; n public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  } main {
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextLong() n sc.nextLong() sc.nextLong sc int min = INF; min INF for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    } long a = 1; long a = 1; a 1 a * a <= n a * a a a n a++ a++ a {
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    } {
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    } if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      } n % a == 0 n % a n a 0 {
        min = Math.min(min, f(a, n / a));
      } min = Math.min(min, f(a, n / a)) min Math.min(min, f(a, n / a)) Math.min Math min f(a, n / a) f a n / a n a System.out.println(min) System.out.println System.out System System.out min String[] args args private static int f(long a, long b){
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  } f {
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  } int ka = 0 ka 0 kb = 0; kb 0 while(a != 0){
      ka++;
      a /= 10;
    } a != 0 a 0 {
      ka++;
      a /= 10;
    } ka++ ka a /= 10 a 10 while(b != 0){
      kb++;
      b /= 10;
    } b != 0 b 0 {
      kb++;
      b /= 10;
    } kb++ kb b /= 10 b 10 return Math.max(ka, kb); Math.max(ka, kb) Math.max Math ka kb long a a long b b public class Main{
  static final int INF = Integer.MAX_VALUE / 2;
  static long n;

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  }

  private static int f(long a, long b){
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  }
} public class Main{
  static final int INF = Integer.MAX_VALUE / 2;
  static long n;

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  }

  private static int f(long a, long b){
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  }
} Main
import java.util.Scanner;

public class Main{
  static final int INF = Integer.MAX_VALUE / 2;
  static long n;

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextLong();

    int min = INF;
    for(long a = 1; a * a <= n; a++){
      if(n % a == 0){
        min = Math.min(min, f(a, n / a));
      }
    }

    System.out.println(min);
  }

  private static int f(long a, long b){
    int ka = 0, kb = 0;
    while(a != 0){
      ka++;
      a /= 10;
    }
    while(b != 0){
      kb++;
      b /= 10;
    }
    return Math.max(ka, kb);
  }
}
