import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  }
  
  public static int f(long a, long b){
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  }
  
  public static int f(long a, long b){
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  } main {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc long tmp = 1; tmp 1 for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    } int i = 2; int i = 2; i 2 i <= Math.sqrt(N) i Math.sqrt(N) Math.sqrt Math N i++ i++ i {
      if(N % i == 0){
        tmp = i;
      }
    } {
      if(N % i == 0){
        tmp = i;
      }
    } if(N % i == 0){
        tmp = i;
      } N % i == 0 N % i N i 0 {
        tmp = i;
      } tmp = i tmp i System.out.println(f(tmp, N/tmp)) System.out.println System.out System System.out f(tmp, N/tmp) f tmp N/tmp N tmp String[] args args public static int f(long a, long b){
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  } f {
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  } int cnt1 = 0; cnt1 0 int cnt2 = 0; cnt2 0 while(a != 0){
      cnt1++;
      a /= 10;
    } a != 0 a 0 {
      cnt1++;
      a /= 10;
    } cnt1++ cnt1 a /= 10 a 10 while(b != 0){
      cnt2++;
      b /= 10;
    } b != 0 b 0 {
      cnt2++;
      b /= 10;
    } cnt2++ cnt2 b /= 10 b 10 return Math.max(cnt1, cnt2); Math.max(cnt1, cnt2) Math.max Math cnt1 cnt2 long a a long b b public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  }
  
  public static int f(long a, long b){
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  }
  
  public static int f(long a, long b){
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long tmp = 1;
    for(int i = 2; i <= Math.sqrt(N); i++){
      if(N % i == 0){
        tmp = i;
      }
    }
    System.out.println(f(tmp, N/tmp));
  }
  
  public static int f(long a, long b){
    int cnt1 = 0;
    int cnt2 = 0;
    while(a != 0){
      cnt1++;
      a /= 10;
    }
    while(b != 0){
      cnt2++;
      b /= 10;
    }
    return Math.max(cnt1, cnt2);
  }
}