import java.io.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    }
  static String rev(String s){
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  }
  static long div(long n){
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  }
  static long cdigit(long a,long b){
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  }
  static long gcd(long a,long b){
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  }
  static long lcm(long a,long b){
    return a*b/gcd(a,b);
  }
  static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    }

    public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    }

    public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    }
  }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    }
  static String rev(String s){
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  }
  static long div(long n){
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  }
  static long cdigit(long a,long b){
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  }
  static long gcd(long a,long b){
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  }
  static long lcm(long a,long b){
    return a*b/gcd(a,b);
  }
  static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    }

    public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    }

    public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    }
  }
} Main public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    } main {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    } InputReader in = new InputReader(System.in); in new InputReader(System.in) PrintWriter w = new PrintWriter(System.out); w new PrintWriter(System.out) long n=in.nextLong(); n in.nextLong() in.nextLong in w.println(div(n)) w.println w div(n) div n w.close() w.close w String[] args args static String rev(String s){
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  } rev {
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  } StringBuilder b=new StringBuilder(s); b new StringBuilder(s) return b.reverse().toString(); b.reverse().toString() b.reverse().toString b.reverse() b.reverse b String s s static long div(long n){
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  } div {
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  } long num=n; num n long c=Long.MAX_VALUE; c Long.MAX_VALUE Long Long.MAX_VALUE for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    } int i=1; int i=1; i 1 i <=Math.sqrt(n) i Math.sqrt(n) Math.sqrt Math n i++ i++ i {
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    } {
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    } if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      } (n%i==0) n%i n i 0 {
        c=Math.min(c,cdigit(n/i,i));
      } c=Math.min(c,cdigit(n/i,i)) c Math.min(c,cdigit(n/i,i)) Math.min Math c cdigit(n/i,i) cdigit n/i n i i return c; c long n n static long cdigit(long a,long b){
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  } cdigit {
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  } return Math.max((Long.toString(a)).length(),(Long.toString(b)).length()); Math.max((Long.toString(a)).length(),(Long.toString(b)).length()) Math.max Math (Long.toString(a)).length() (Long.toString(a)).length (Long.toString(a)) Long.toString Long a (Long.toString(b)).length() (Long.toString(b)).length (Long.toString(b)) Long.toString Long b long a a long b b static long gcd(long a,long b){
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  } gcd {
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  } if (b ==0)
    return a;
    else
    return gcd(b,a%b); b ==0 b 0 return a; a return gcd(b,a%b); gcd(b,a%b) gcd b a%b a b long a a long b b static long lcm(long a,long b){
    return a*b/gcd(a,b);
  } lcm {
    return a*b/gcd(a,b);
  } return a*b/gcd(a,b); a*b/gcd(a,b) a*b a b gcd(a,b) gcd a b long a a long b b static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    }

    public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    }

    public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    }
  } InputReader private final InputStream stream; stream private final byte[] buf = new byte[8192]; buf new byte[8192] 8192 private int curChar curChar snumChars; snumChars private SpaceCharFilter filter; filter public InputReader(InputStream stream) {
      this.stream = stream;
    } InputReader {
      this.stream = stream;
    } this.stream = stream this.stream this this.stream stream InputStream stream stream public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    } snext {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    } if (snumChars == -1)
      throw new InputMismatchException(); snumChars == -1 snumChars -1 1 throw new InputMismatchException(); new InputMismatchException() if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      } curChar >= snumChars curChar snumChars {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      } curChar = 0 curChar 0 try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        } catch (IOException e) {
          throw new InputMismatchException();
        } IOException e {
          throw new InputMismatchException();
        } throw new InputMismatchException(); new InputMismatchException() {
          snumChars = stream.read(buf);
        } snumChars = stream.read(buf) snumChars stream.read(buf) stream.read stream buf if (snumChars <= 0)
        return -1; snumChars <= 0 snumChars 0 return -1; -1 1 return buf[curChar++]; buf[curChar++] buf curChar++ curChar public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    } nextInt {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    } int c = snext(); c snext() snext while (isSpaceChar(c)) {
        c = snext();
      } isSpaceChar(c) isSpaceChar c {
        c = snext();
      } c = snext() c snext() snext int sgn = 1; sgn 1 if (c == '-') {
        sgn = -1;
        c = snext();
      } c == '-' c '-' {
        sgn = -1;
        c = snext();
      } sgn = -1 sgn -1 1 c = snext() c snext() snext int res = 0; res 0 do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } if (c < '0' || c > '9')
        throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = snext() c snext() snext return res * sgn; res * sgn res sgn public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    } nextLong {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    } int c = snext(); c snext() snext while (isSpaceChar(c)) {
        c = snext();
      } isSpaceChar(c) isSpaceChar c {
        c = snext();
      } c = snext() c snext() snext int sgn = 1; sgn 1 if (c == '-') {
        sgn = -1;
        c = snext();
      } c == '-' c '-' {
        sgn = -1;
        c = snext();
      } sgn = -1 sgn -1 1 c = snext() c snext() snext long res = 0; res 0 do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } if (c < '0' || c > '9')
        throw new InputMismatchException(); c < '0' || c > '9' c < '0' c '0' c > '9' c '9' throw new InputMismatchException(); new InputMismatchException() res *= 10 res 10 res += c - '0' res c - '0' c '0' c = snext() c snext() snext return res * sgn; res * sgn res sgn public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    } nextIntArray {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    } int a[] = new int[n]; a new int[n] n for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        a[i] = nextInt();
      } {
        a[i] = nextInt();
      } a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    } readString {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    } int c = snext(); c snext() snext while (isSpaceChar(c)) {
        c = snext();
      } isSpaceChar(c) isSpaceChar c {
        c = snext();
      } c = snext() c snext() snext StringBuilder res = new StringBuilder(); res new StringBuilder() do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c)); !isSpaceChar(c) isSpaceChar(c) isSpaceChar c {
        res.appendCodePoint(c);
        c = snext();
      } res.appendCodePoint(c) res.appendCodePoint res c c = snext() c snext() snext return res.toString(); res.toString() res.toString res public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    } nextLine {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    } int c = snext(); c snext() snext while (isSpaceChar(c))
      c = snext(); isSpaceChar(c) isSpaceChar c c = snext() c snext() snext StringBuilder res = new StringBuilder(); res new StringBuilder() do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c)); !isEndOfLine(c) isEndOfLine(c) isEndOfLine c {
        res.appendCodePoint(c);
        c = snext();
      } res.appendCodePoint(c) res.appendCodePoint res c c = snext() c snext() snext return res.toString(); res.toString() res.toString res public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } isSpaceChar {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    } if (filter != null)
      return filter.isSpaceChar(c); filter != null filter null return filter.isSpaceChar(c); filter.isSpaceChar(c) filter.isSpaceChar filter c return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == '\t' c == '\r' c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1 c == ' ' c ' ' c == '\n' c '\n' c == '\r' c '\r' c == '\t' c '\t' c == -1 c -1 1 int c c private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    } isEndOfLine {
      return c == '\n' || c == '\r' || c == -1;
    } return c == '\n' || c == '\r' || c == -1; c == '\n' || c == '\r' || c == -1 c == '\n' || c == '\r' || c == -1 c == '\n' c '\n' c == '\r' c '\r' c == -1 c -1 1 int c c public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    } SpaceCharFilter public boolean isSpaceChar(int ch); isSpaceChar int ch ch public class Main {

  public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    }
  static String rev(String s){
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  }
  static long div(long n){
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  }
  static long cdigit(long a,long b){
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  }
  static long gcd(long a,long b){
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  }
  static long lcm(long a,long b){
    return a*b/gcd(a,b);
  }
  static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    }

    public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    }

    public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    }
  }
} public class Main {

  public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    }
  static String rev(String s){
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  }
  static long div(long n){
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  }
  static long cdigit(long a,long b){
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  }
  static long gcd(long a,long b){
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  }
  static long lcm(long a,long b){
    return a*b/gcd(a,b);
  }
  static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    }

    public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    }

    public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    }
  }
} Main
import java.io.*;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    InputReader in = new InputReader(System.in);
    PrintWriter w = new PrintWriter(System.out);
    long n=in.nextLong();
    w.println(div(n));
    w.close();
    }
  static String rev(String s){
    StringBuilder b=new StringBuilder(s);
    return b.reverse().toString();
  }
  static long div(long n){
    long num=n;
    long c=Long.MAX_VALUE;
    for(int i=1;i <=Math.sqrt(n);i++){
      if ((n%i==0)){
        c=Math.min(c,cdigit(n/i,i));
      }
    }
    return c;
  }
  static long cdigit(long a,long b){
    return Math.max((Long.toString(a)).length(),(Long.toString(b)).length());
  }
  static long gcd(long a,long b){
    if (b ==0)
    return a;
    else
    return gcd(b,a%b);
  }
  static long lcm(long a,long b){
    return a*b/gcd(a,b);
  }
  static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int snext() {
      if (snumChars == -1)
      throw new InputMismatchException();
      if (curChar >= snumChars) {
        curChar = 0;
        try {
          snumChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (snumChars <= 0)
        return -1;
      }
      return buf[curChar++];
    }

    public int nextInt() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public long nextLong() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = snext();
      }
      long res = 0;
      do {
        if (c < '0' || c > '9')
        throw new InputMismatchException();
        res *= 10;
        res += c - '0';
        c = snext();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public int[] nextIntArray(int n) {
      int a[] = new int[n];
      for (int i = 0; i < n; i++) {
        a[i] = nextInt();
      }
      return a;
    }

    public String readString() {
      int c = snext();
      while (isSpaceChar(c)) {
        c = snext();
      }
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public String nextLine() {
      int c = snext();
      while (isSpaceChar(c))
      c = snext();
      StringBuilder res = new StringBuilder();
      do {
        res.appendCodePoint(c);
        c = snext();
      } while (!isEndOfLine(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null)
      return filter.isSpaceChar(c);
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
      return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);
    }
  }
}
