import java.util.*;

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

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  }
  
  private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  }
  
  private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  }
} 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 min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  }
  
  private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  }
  
  private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

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

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N = sc.nextLong(); N sc.nextLong() sc.nextLong sc int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    } int i = 1; int i = 1; i 1 (long)i*i <= N (long)i*i (long)i i N i++ i++ i {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    } {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    } if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      } N%i == 0 N%i N i 0 {
        min = Math.min(min, F(i, N/i));
      } min = Math.min(min, F(i, N/i)) min Math.min(min, F(i, N/i)) Math.min Math min F(i, N/i) F i N/i N i System.out.println(min) System.out.println System.out System System.out min String[] args args private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  } F {
    return Math.max(digit(a), digit(b));
  } return Math.max(digit(a), digit(b)); Math.max(digit(a), digit(b)) Math.max Math digit(a) digit a digit(b) digit b long a a long b b private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  } digit {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  } int ret = 0; ret 0 while (n != 0) {
      n /= 10;
      ret++;
    } n != 0 n 0 {
      n /= 10;
      ret++;
    } n /= 10 n 10 ret++ ret return ret; ret long n n public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  }
  
  private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  }
  
  private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  }
  
  private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  }
  
  private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  }
} Main
import java.util.*;

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

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  }
  
  private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  }
  
  private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  }
}