import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    int ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  }
} 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 ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    int ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    int ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int ans = Integer.MAX_VALUE; ans Integer.MAX_VALUE Integer Integer.MAX_VALUE for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    } long i = 1; long i = 1; i 1 i * i <= N i * i i i N i++ i++ i {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    } {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    } if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      } N % i == 0 N % i N i 0 {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      } long b = N / i; b N / i N i int digit = 0; digit 0 for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        } int j = 0; int j = 0; j 0 j <= 11 j 11 j++ j++ j {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        } {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        } if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          } b < (long)Math.pow(10, j) b (long)Math.pow(10, j) Math.pow Math 10 j {
            digit = j;
            break;
          } digit = j digit j break; ans = Math.min(ans, digit) ans Math.min(ans, digit) Math.min Math ans digit System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    int ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    int ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    int ans = Integer.MAX_VALUE;
    for(long i = 1; i * i <= N; i++) {
      if(N % i == 0) {
        long b = N / i;
        int digit = 0;
        for(int j = 0; j <= 11; j++) {
          if(b < (long)Math.pow(10, j)) {
            digit = j;
            break;
          }
        }
        ans = Math.min(ans, digit);
      }
    }
    System.out.println(ans);
  }
}