import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  }

  private static int digit(long x) {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  }

  private static int digit(long x) {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  }
} Main public static void main(String[] args) {
    solve(System.in, System.out);
  } main {
    solve(System.in, System.out);
  } solve(System.in, System.out) solve System.in System System.in System.out System System.out String[] args args static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  } solve {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  } Scanner sc = new Scanner(is); sc new Scanner(is) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc long sqrtn = (long) Math.sqrt(n); sqrtn (long) Math.sqrt(n) Math.sqrt Math n int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    } long a = 1; long a = 1; a 1 a <= sqrtn a sqrtn a++ a++ a {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    } {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    } long b = n / a; b n / a n a if (a * b != n) continue; a * b != n a * b a b n continue; min = Math.min(min, Math.max(digit(a), digit(b))) min Math.min(min, Math.max(digit(a), digit(b))) Math.min Math min Math.max(digit(a), digit(b)) Math.max Math digit(a) digit a digit(b) digit b os.println(min) os.println os min InputStream is is PrintStream os os private static int digit(long x) {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  } digit {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  } int d = 0; d 0 while (x > 0) {
      x /= 10;
      d++;
    } x > 0 x 0 {
      x /= 10;
      d++;
    } x /= 10 x 10 d++ d return d; d long x x public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  }

  private static int digit(long x) {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  }
} public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  }

  private static int digit(long x) {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    long n = sc.nextLong();

    long sqrtn = (long) Math.sqrt(n);
    int min = Integer.MAX_VALUE;
    for (long a = 1; a <= sqrtn; a++) {
      long b = n / a;
      if (a * b != n) continue;
      min = Math.min(min, Math.max(digit(a), digit(b)));
    }
    os.println(min);
  }

  private static int digit(long x) {
    int d = 0;
    while (x > 0) {
      x /= 10;
      d++;
    }
    return d;
  }
}
