jiahuimbzuai/CoQuIR huggingface dataset:
//  [typescript]
declare function require(x: string): any;
let input: string
try {
  input = require('fs').readFileSync('/dev/stdin', 'utf8')
}
catch{
  input = require('fs').readFileSync('./input.txt', 'utf8')
}


const secondWord: string = input.split(" ")[1]

console.log('A' + secondWord.slice(0, 1) + "C")
//  [python]
import math
n = int(input())

ini = 1 if n%2 else 2
div = []
for i in range(ini, int(math.sqrt(n)+1),2):
  if n%i==0:
    div.append([i,n//i])
print(max(len(str(div[-1][0])),len(str(div[-1][1]))))
//  [python]
import math


def divisor(div, n):
    # 約数
    ini = 1 if n % 2 else 2
    for i in range(ini, int(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            div.append([i, n // i])


def main():
    N = int(input())
    div = []
    divisor(div, N)
    print(max(int(math.log10(div[-1][0]) + 1),
              int(math.log10(div[-1][1]) + 1)))
    return


main()
//  [python]
n = int(input())
import math
def F (a,b):
    a_len = len(str(a))
    b_len = len(str(b))
    return max(a_len,b_len)
result = 0
if n % 2 == 0:
    for i in range(2,int(math.sqrt(n))+1,2):
        if n % i == 0:
            result = len(str(n//i))
else:
    for j in range(1,int(math.sqrt(n))+1,2):
        if n % j == 0:
            result = len(str(n//j))
print(result)
//  [python]
n=int(input())

def f(a,b):
    return max(len(str(a)),len(str(b)))
m=10000
for a in range(1,10**10):
    if n%a==0:
        print(a)
        m=min(f(a,n//a),m)
    if n<a or n//a<a:
        break
print(m)
//  [python]
n=int(input())

def f(a,b):
    return max(len(str(a)),len(str(b)))
m=10000
for a in range(1,10**10):
    if n%a==0:
        m=min(f(a,n//a),m)
    if n<a:
        break
print(m)
//  [python]
import math
n=int(input())
ans=100
for a in range(1,int(math.sqrt(n))):
    if n%a==0:
        m=max(len(str(a)),len(str(n//a)))
        ans=min(ans,m)
print(ans)
//  [java]

import java.util.*;
import java.io.*;
public class Main {
    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        long n = fs.nextLong();
        List<Long> factors = new ArrayList<>();
        for(long i=1;i*i<=n;i++){
            if(n%i==0){
                factors.add(n/i);
            }
        }
        long val = factors.get(factors.size()-1);
        int digit = 0;
        while(val > 0){
            val/=10;
            digit++;
        }
        System.out.println(digit);
    }
    static class FastScanner {
            private final InputStream in = System.in;
            private final byte[] buffer = new byte[1024];
            private int ptr = 0;
            private int buflen = 0;
            private boolean hasNextByte() {
                if (ptr < buflen) {
                    return true;
                }else{
                    ptr = 0;
                    try {
                        buflen = in.read(buffer);
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                    if (buflen <= 0) {
                        return false;
                    }
                }
                return true;
            }
            private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
            private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
            public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
            public String next() {
                if (!hasNext()) throw new NoSuchElementException();
                StringBuilder sb = new StringBuilder();
                int b = readByte();
                while(isPrintableChar(b)) {
                    sb.appendCodePoint(b);
                    b = readByte();
                }
                return sb.toString();
            }
            public long nextLong() {
                if (!hasNext()) throw new NoSuchElementException();
                long n = 0;
                boolean minus = false;
                int b = readByte();
                if (b == '-') {
                    minus = true;
                    b = readByte();
                }
                if (b < '0' || '9' < b) {
                    throw new NumberFormatException();
                }
                while(true){
                    if ('0' <= b && b <= '9') {
                        n *= 10;
                        n += b - '0';
                    }else if(b == -1 || !isPrintableChar(b)){
                        return minus ? -n : n;
                    }else{
                        throw new NumberFormatException();
                    }
                    b = readByte();
                }
            }
            public int nextInt() {
                long nl = nextLong();
                if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
                return (int) nl;
            }
            public double nextDouble() { return Double.parseDouble(next());}
        }
}
//  [java]
import java.io.*;
import java.util.*;

public class Main {
  private static int width(long v) {
    int w = 0;
    while (v > 0) {
      v /= 10;
      w++;
    }
    return w;
  }
  
  private static int solve(long n) {
    int answer = Integer.MAX_VALUE;
    for (long k = 1; k * k <= n; k++) {
      if (n % k != 0) {
        continue;
      }
      answer = Math.min(answer, width(n / k));
    }
    return answer;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    long n = reader.nextLong();
    out.println(solve(n));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}
//  [java]
package practise;

import java.util.*;

public class Main {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long right;
		long left;
		
		long min=1000000000;
		long max;
		for(long i=1;i<=n/2;i++)
		{
			if(n%i==0)
			{
				right=n/i;
				if(right>i) max=right;
				else max=i;
				min=Math.min(min,(long)Math.log10(max)+1);
				
			}
		}
		System.out.println(min);
		
	}

}
//  [java]


import java.util.*;

public class Main2 {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long right;
		long left;
		
		long min=1000000000;
		long max;
		for(long i=1;i<=n/2;i++)
		{
			if(n%i==0)
			{
				right=n/i;
				if(right>i) max=right;
				else max=i;
				min=Math.min(min,(long)Math.log10(max)+1);
				
			}
		}
		System.out.println(min);
		
	}

}
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.HashMap;
import java.util.Collections;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DigitsMultiplication solver = new DigitsMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class DigitsMultiplication {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long n = in.nextLong();
            HashMap<Long, Long> map = primeFactorize(n);
            List<Long> list = new ArrayList<>(map.keySet());
            list.sort(Collections.reverseOrder());
            long a = 1;
            long b = 1;

            if (n == 1) {
                out.println(1);
                return;
            }
            for (Long key : list) {
                Long limit = map.get(key);
                for (int j = 0; j < limit; j++) {
                    if (String.valueOf(a).length() < String.valueOf(b).length()) {
                        a *= key;
                    } else {
                        b *= key;
                    }
                }
            }

            int result = Math.max(
                    String.valueOf(a).length(),
                    String.valueOf(b).length()
            );
            out.println(result);
        }

        static HashMap<Long, Long> primeFactorize(long x) {
            HashMap<Long, Long> result = new HashMap<>();
            for (long i = 2; i * i <= x; i++) {
                if (x % i != 0) {
                    continue;
                }
                long ex = 0;
                while (x % i == 0) {
                    ex++;
                    x /= i;
                }
                result.put(i, ex);
            }
            if (x != 1) {
                result.put(x, 1L);
            }
            return result;
        }

    }
}
//  [cpp]
#include <stdio.h>
#include <math.h>
#ifdef _MSC_VER
#include <conio.h>
#else
#define getch()
#include <climits>
#define _CRT_INT_MAX INT_MAX
#endif

int mysqrt(long long int x){
	int a=0,c=0,y=0,i=0,t=x;
	while(t>>=1){
		++i;
	}
	for(i+=i&1; i>=0; i-=2){
		c=(y<<1|1)<=x>>i;
		a=a<<1|c;
		y=y<<1|c;
		x-=c * y<<i;
		/* if(c){
		x -= y << i;
		} */
		y+=c;
	}
	return a;
}

int Digits(long long int A){
	return log10(A)+1;
}

inline int Min(int A,int B){
	return A<=B?A:B;
}

inline long long int Max(int A,int B){
	return A>=B?A:B;
}

int main(){
	long long int N=0;
	int Ans=0;
	scanf(" %lld",&N);
	long long int Sqrt=sqrt(N);
	bool TickFlag=false;
	int Tick=1;
	if(N%2!=0)TickFlag=true;
	for(long long int i=Sqrt;;i-=Tick){
		if(TickFlag==true&&Tick==1&&i%2!=0){
			Tick=2;
		}
		if(N%i==0){
			Ans=Max(Digits(i),Digits(N/i));
			break;
		}
	}
	printf("%d\n",Ans);
	getch();
}
//  [cpp]
#include <cstdio>
#include <algorithm>
using namespace std;

typedef long long ll;

int DigitNum(ll x)
{
	int r = 0;
	while (x > 0)
	{
		x /= 10;
		++r;
	}
	return r;
}

int main()
{
	long long N;
	scanf("%lld", &N);

	ll dMax = 0;
	for (ll d = 2; d*d <= N; ++d)
	{
		if (N % d)
			continue;
		dMax = d;
	}

	ll r = N;
	if (dMax)
	{
		r = N / dMax;
	}
	int ans = DigitNum(r);
	printf("%d\n", ans);

	return 0;
}
//  [cpp]
#include<cstdio>
#include<algorithm>
using namespace std;
using ull = unsigned long long;

int Digits(ull n){
	int res = 1;
	while(n /= 10){
		res++;
	}
	return res;
}

int main(){
	ull N;
	scanf("%llu", &N);
	int answer = Digits(N);
	for (ull i = 2; i*i <= N; ++i){
		if(!(N % i)) answer = min(answer, Digits(N/i));
	}
	printf("%d\n", answer);
	return 0;
}
//  [cpp]
#include<iostream>
#include<algorithm>
#include<cstring>
#include<functional>
#include<vector>
using namespace std;

long long int ketasuu(long long int a){
  long long int c=0;
  while(a!=0){
    a /=10;
    c++;
  }
  return c;
}

int main(){
  long long int n;
  cin>>n;
  long long int ans=n;
  for(long long int i=1;i<=(n/2);i++){
    if(n%i==0){
      ans=min(ans,max(ketasuu(i),ketasuu(n/i)));
    }
  }
  cout<<ans<<endl;
}
//  [cpp]
#include<iostream>
#include<algorithm>
#include<cstring>
#include<functional>
#include<vector>
using namespace std;

long long int ketasuu(long long int a){
  long long int c=0;
  while(a!=0){
    a /=10;
    c++;
  }
  return c;
}

int main(){
  long long int n;
  cin>>n;
  long long int ans=n;
  for(long long int i=1;i<=n;i++){
    if(n%i==0){
      ans=min(ans,max(ketasuu(i),ketasuu(n/i)));
    }
  }
  cout<<ans<<endl;
}
//  [cpp]
#include <iostream>

using namespace std;

int get_digit(long long x) {
  int res = 0;
  while (x > 0) {
    res++;
    x /= 10;
  }
  return res;
}

long long sqrt_floor(long long x) {
  long long l = 0, r = x+1, m;
  while (l + 1 < r) {
    m = (l + r) / 2;
    (m * m <= x ? l : r) = m;
  }
  return l;
}

int main() {
  long long N;
  cin >> N;

  long long d = sqrt_floor(N);

  do {
    if (N % d == 0) {
      cout << get_digit(N / d) << endl;
      break;
    }
  } while (--d > 0);
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
int cmp(const void *a, const void *b);
//your code here!
ll F(ll a, ll b);
int main(void){
    ll N, s, i;
    scanf("%lld", &N);
    ll MIN = F(1, N);
    if(N%2==0) s=2;
    else s=3;
    for(i=s; i<=sqrt(N); i+=2){
        if(N%i==0){
            chmin(MIN, F(i, N/i));
        }
    }
    printf("%lld\n", MIN);
    return 0;
}
ll F(ll a, ll b){
    ll w, cnt=0;
    if(a>b) w=a;
    else w=b;
    while(w!=0){
        w /= 10;
        cnt++;
    }
    return cnt;
}
int cmp(const void *a, const void *b){
    ll A=*(ll *)a, B=*(ll *)b;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート
}
//  [c]
#include <stdio.h>
#include <inttypes.h>

uint64_t soinsu[32];
int soinsuNum[32];
int soinsuCount = 0;

int search(int idx, uint64_t A, uint64_t B) {
	if (idx >= soinsuCount) {
		int Acnt = 0, Bcnt = 0;
		while (A > 0) Acnt++, A /= 10;
		while (B > 0) Bcnt++, B /= 10;
		return Acnt >= Bcnt ? Acnt : Bcnt;
	} else {
		int i;
		int result = 9999;
		for (i = 0; i <= soinsuNum[idx]; i++) {
			uint64_t newA = A, newB = B;
			int j;
			int candidate;
			for (j = 0; j < soinsuNum[idx]; j++) {
				if (j < i) newA *= soinsu[idx]; else newB *= soinsu[idx];
			}
			candidate = search(idx + 1, newA, newB);
			if (candidate < result) result = candidate;
		}
		return result;
	}
}

int main(void) {
	uint64_t N;
	uint64_t d;
	if (scanf("%" SCNu64, &N) != 1) return 1;
	for (d = 2; d * d <= N; d++) {
		if (N % d == 0) {
			soinsu[soinsuCount] = d;
			soinsuNum[soinsuCount] = 0;
			while (N % d == 0) {
				N /= d;
				soinsuNum[soinsuCount]++;
			}
			soinsuCount++;
		}
	}
	if (N > UINT64_C(1)) {
		soinsu[soinsuCount] = N;
		soinsuNum[soinsuCount] = 1;
		soinsuCount++;
	}
	printf("%d\n", search(0, 1, 1));
	return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
int cmp(const void *a, const void *b);
//your code here!
ll F(ll a, ll b);
int main(void){
    ll N, s, i;
    scanf("%lld", &N);
    ll MIN = F(1, N);
    if(N%2==0) s=2;
    else s=3;
    for(i=s; i<=sqrt(N); i+=2){
        if(N%i==0){
            chmin(MIN, F(i, N/i));
        }
    }
    printf("%lld\n", MIN);
    return 0;
}
ll F(ll a, ll b){
    ll w=max(a,b), cnt=0;
    while(w!=0){
        w /= 10;
        cnt++;
    }
    return cnt;
}
int cmp(const void *a, const void *b){
    ll A=*(ll *)a, B=*(ll *)b;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート
}
//  [c]
#include <stdio.h>

int main() {
  int i,j,h,A,B,F,F1,F2,N;
  scanf("%d",&N);
  while((N>=(10^10)) && (N<=1)){
  scanf("%d",&N);
  }
  for(i=1;i<N;i++){
    if(N%i==0){
      A=N/i;
      B=N/A;
      for(j=1;A>10;j++)A=A/10;
      for(h=1;B>10;h++)B=B/10;
      if((F1=0) || (F1<j)){
        F1=j;
      }
      if((F2=0) || (F2<h)){
        F2=h;
      }
    }
  }
  F=F2-F1;
  if(F<0){
    F=F*(-1);
  }
  printf("%d",F);
  return 0;
}
//  [c]
#include<stdio.h>
#include<math.h>

int main()
{
  long long n;
  double s;
  int i;
  int a;
  int max=0;
  int ans;
  scanf("%lld",&n);
  s=sqrt(n);
  for(i=1;i<=s;i++){
    a=n/i;
    if(n%a==0){
      max=a;
    }
  }
  a=max;
  for(i=1;;i++){
    a/=10;
    if(a==0){
      ans=i; 
      break;
    }
  }
  printf("%d",ans);
  return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>

int max(int a, int b){
  if(a > b) return a;
  else return b;
}

int min(int a, int b){
  if(a < b) return a;
  else return b;
}

typedef long long ll;

ll check_digit(ll a){

  int digit = 1;
  while( (a / 10) > 0 ){
    ++digit;
    a /= 10;
  }

  return digit;

}

int main(){

  ll n;
  scanf("%lld",&n);

  ll ans =100000000000000000;
  for(ll a = 1; a*a < n; ++a){
    if(n % a != 0) continue;
    ll b = n/a;
    int tmp = max(check_digit(a),check_digit(b));
    ans = min(ans,tmp);
  }

  printf("%d",ans);

  return 0;

}
//  [javascript]
function main(input) {
    var n = input[0]-0;
    var ans = 0;
    for(var i=~~Math.sqrt(n);i>0;i--){
        if(n%i==0){ ans = (~~Math.log10(n/i))+1; break;}
    }
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
//  [javascript]
'use strict'

function main(s) {

  const N = Number(s);
  let answer = 11;

  for (let i = 1; i <= Math.sqrt(N); i++) {
    if (Number.isInteger(N / i)) {
      const f = Math.max(String(i).length, String(N / i).length);
      answer = Math.min(answer, f);
    }
  }

  console.log(answer);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
    
const main = arg => {
    const N = parseInt(arg.split("\n")[0]);
  	let ans = 0;
 	let m = 0;
  	let roopNum = Math.sqrt(N);
  	for(let i = 1; i <= roopNum; i++){
    	if(N % i == 0){
        	m = i
        }
    }
  	// 約数同士でどちらが大きいかを比較
	ans = N/m > m ? N/m : m;
  	console.log(String(ans).length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input){
	input=input.trim().split("\n");
	var N = parseInt(input,10);
	var rootN = Math.floor(Math.sqrt(N));
	var A;
	for (var i = rootN; i <= N; i++){
		if (N % i == 0){
			A = i;
			console.log(F(A));
			break;
		}	
    }
}

function F(x){
	var i = 1;
	var j = 1;
	while(true){
		j *= 10;
		if (x >= j){
			i++;
		} else {
			return i;
			break;
		}
	}
}	

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input){
	input=input.trim().split("\n");
	let N = parseInt(input,10);
	let rootN = Math.floor(Math.sqrt(N));
	let A;
	for (let i = rootN; i <= N; i++){
		if (N % i == 0){
			A = i;
			console.log(F(A));
			break;
		}	
    }
}

function F(x){
	let i = 1;
	let j = 1;
	while(true){
		j *= 10;
		if (x >= j){
			i++;
		} else {
			return i;
			break;
		}
	}
}	

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function main(lines) {
    const input = lines-0
    var output = []
    for(var i=1; i*i<= input; i++){
        const a = input/i
        const b = input/a
        output.push( Math.max(a.toString().length, b.toString().length) )
    }
    const result = output.sort(function(a,b){return a-b})[0] 
    console.log(result)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
// 約数作るだけでは

package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	divs := enumDiv(N)
	ans := int(1e10)
	for _, a := range divs {
		b := N / a
		ans = min(ans, max(keta(a), keta(b)))
	}
	fmt.Println(ans)
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func keta(x int) int {
	ret := 0
	for x > 0 {
		ret += 1
		x /= 10
	}
	return ret
}

func enumDiv(x int) (ret []int) {
	ret = []int{}
	for i := 1; i*i <= x; i++ {
		if x%i == 0 {
			ret = append(ret, i)
			if i != 1 && i*i != x {
				ret = append(ret, x/i)
			}
		}
	}
	return
}
//  [go]
// 全探索 しにくくない？ 約数の組を作っていく
// 1からインクリメントで割るのは間に合わないがa*b=N(a<b)なら√Nでいい
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scan(&N)
	divs := enumDiv(N)
	sort.Ints(divs)
	ans := 10000000000000
	for _, d := range divs {
		tmp := max(d, N/d)
		keta := 0
		for ; tmp > 0; tmp /= 10 {
			keta++
		}
		ans = min(ans, keta)
	}
	fmt.Println(ans)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func enumDiv(x int) (ret []int) {
	ret = []int{}
	for i := 1; i*i <= x; i++ {
		if x%i == 0 {
			ret = append(ret, i)
			if i != 1 && i*i != x {
				ret = append(ret, x/i)
			}
		}
	}
	if len(ret) == 1 {
		ret = append(ret, x)
	}
	return
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"sort"
	"strconv"
)

func main() {
	n := readi()

	d := divisor(n)
	s := strconv.Itoa(d[len(d)/2])
	fmt.Println(len(s))
}

// func divisor(n int) (res []int) {
// 	for i := 1; i <= n; i++ {
// 		if n%i == 0 {
// 			res = append(res, n/i)
// 		}
// 	}
// 	return
// }

func divisor(n int) (res []int) {
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i*i != n {
				res = append(res, n/i)
			}
		}
	}
	sort.Ints(res)
	return
}

/*-------------------utilities-------------------*/

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func chmin(x *int, y int) bool {
	if *x > y {
		*x = y
		return true
	}
	return false
}

func chmax(x *int, y int) bool {
	if *x < y {
		*x = y
		return true
	}
	return false
}

// 最大公約数
func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

// 最小公倍数
func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func comb(n, k int) int {
	if n < k {
		return 0
	}
	if n < 0 || k < 0 {
		return 0
	}
	return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD
}

func permutations(arr []int) [][]int {
	var helper func([]int, int)
	res := [][]int{}

	helper = func(arr []int, n int) {
		if n == 1 {
			tmp := make([]int, len(arr))
			copy(tmp, arr)
			res = append(res, tmp)
		} else {
			for i := 0; i < n; i++ {
				helper(arr, n-1)
				if n%2 == 1 {
					tmp := arr[i]
					arr[i] = arr[n-1]
					arr[n-1] = tmp
				} else {
					tmp := arr[0]
					arr[0] = arr[n-1]
					arr[n-1] = tmp
				}
			}
		}
	}
	helper(arr, len(arr))
	return res
}

/*-------------------init-------------------*/

const (
	INF = 1000000000000000000
	MOD = 1e9 + 7

	COMB_MAX = 510000
)

var (
	readString func() string
)

var (
	fac  = [COMB_MAX]int{}
	finv = [COMB_MAX]int{}
	inv  = [COMB_MAX]int{}
)

func init() {
	readString = newReadString(os.Stdin)
}

func combInit() {
	fac[0] = 1
	fac[1] = 1
	finv[0] = 1
	finv[1] = 1
	inv[1] = 1
	for i := 2; i < COMB_MAX; i++ {
		fac[i] = fac[i-1] * i % MOD
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD
		finv[i] = finv[i-1] * inv[i] % MOD
	}
}

/*-------------------inputs-------------------*/

func readi() int {
	return int(readi64())
}

func readi64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readf() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}
//  [go]
package main

import (
	"fmt"
	"math"
	"sort"
)

func main () {
	var n int
	fmt.Scan(&n)


	min := 1e10
	for i := 1; i * i <= n; i++ {
		if n % i == 0 {
			j := n / i
			max := math.Max(float64(calcDigit(i)), float64(calcDigit(j)))
			min = math.Min(max, min)
		}
	}
	fmt.Println(min)
}

// 桁数を返す
func calcDigit(n int) int {
	cnt := 0
	for n > 0 {
		cnt++
		n = n / 10
	}
	return cnt
}
//  [go]
package main

import (
	"fmt"
	"math"
	"sort"
)

func main () {
	var n int
	fmt.Scan(&n)


	min := 1e10
	for i := 1; i * i <= n; i++ {
		if n % i == 0 {
			j := n / i
			max := math.Max(float64(calcDigit(i)), float64(calcDigit(j)))
			min = math.Min(max, min)
		}
	}
	fmt.Println(min)
}


func calcDigit(n int) int {
	cnt := 0
	for n > 0 {
		cnt++
		n = n / 10
	}
	return cnt
//  [ruby]
# 整数 N が与えられます。ここで、2 つの正の整数 A,B に対して、
# F(A,B) を「10 進表記における、A の桁数と B の桁数のうち大きい方」と定義します。
# 例えば、F(3,11) の値は、3 は 1 桁、11 は 2 桁であるため、F(3,11)=2 となります。
# 2 つの正の整数の組 (A,B) が N=A×B を満たすように動くとき、F(A,B) の最小値を求めてください。

n = gets.to_i

def comparison(i, j)
    return  i.to_s.length >= j.to_s.length ? i.to_s.length : j.to_s.length
end

if Math.sqrt(n) % 1 == 0
    puts Math.sqrt(n).to_i.to_s.length
else
    num = Math.sqrt(n).to_i
    while n % num != 0
        num -= 1
    end
    puts (n / num).to_s.length >= num.to_s.length ? (n / num).to_s.length : num.to_s.length
end
//  [ruby]
N = gets.to_i
n = Math.sqrt(N).floor;

while n >= 1 do
	if (N % n == 0)
		print (N/n).to_s.size, "\n"
		break
	end
	n -= 1
end
//  [ruby]
n = gets.chomp.to_i
 
res = Math.sqrt(n).floor
 
while res > 1 do
  break if n%res==0
  res -= 1
end
 
puts Math.log10(n/res).floor + 1
//  [ruby]
n = gets.to_i
sqrt = Math.sqrt(n).to_i
i = 1
min = sqrt
while i < sqrt
  if n % i == 0
    if (n / i).to_s.length < min
      min = (n / i).to_s.length
    end
  end
  i += 1
end
puts min
//  [ruby]
n = gets.chomp.to_i
mm = (n ** 0.5).ceil
    mm.upto(n) do |i|
        amari = n % i
        if amari == 0
             puts (i.to_s).size
            break
        end
    end
//  [ruby]
n = gets.chomp.to_i
mm = (n ** 0.5).ceil
    mm.upto(n) do |i|
        p i
        amari = n % i
        if amari == 0
             puts (i.to_s).size
            break
        end
    end
//  [rust]
use proconio::input;
fn main() {
    input!{
        mut n:i64,
    }
    let v:Vec<i64>=func(n);
    let mut ans:i64=digit(n);
    for i in v{
        ans=std::cmp::min(ans,digit(i));
    }
    println!("{}",ans);
}

fn digit(mut n:i64)->i64{
    let mut res:i64=0;
    while n>0{
        n/=10;
        res+=1;
    }
    res
}

fn func(n:i64)->Vec<i64>{
    let mut v:Vec<i64>=Vec::new();
    for i in 2..((n as f64).sqrt() as i64 +1){
        if n%i==0{
            v.push(n/i);
        }
    }
    v
}
//  [rust]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn count_digits(n: usize) -> usize {
    let mut ret = 0;
    let mut rem = n;
    while rem != 0 {
        ret += 1;
        rem /= 10;
    }
    ret
}

fn F(a: usize, b: usize) -> usize {
    max(count_digits(a), count_digits(b))
}

const INF: usize = 1 << 60;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: usize = sc.get();
    let mut ans = INF;
    for i in (1..).take_while(|i| i * i <= N) {
        if N % i == 0 {
            ans = min(ans, F(N/i, i));
        }
    }
    println!("{}", ans);
}
//  [rust]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn count_digit(n: usize) -> usize {
    let mut ret = 0;
    let mut rem = n;
    while rem != 0 {
        rem /= 10;
        ret += 1;
    }
    ret
}

fn F(a: usize, b: usize) -> usize {
    max(count_digit(a), count_digit(b))
}

const INF: usize = 1 << 60;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let N: usize = sc.get();
    let mut ans = INF;
    for i in (1..).take_while(|k| k * k <= N) {
        if N % i == 0 {
            ans = min(ans, F(i, N/i));
        }
    }
    println!("{}", ans);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize,
    }

    let mut a = (n as f64).sqrt() as usize;
    let b = 
        loop {
            if n % a == 0 {
                break n / a;
            }
            a += 1;
        };

    let mut length = a.to_string().chars().collect::<Vec<_>>().len();
    length = std::cmp::max(length, b.to_string().chars().collect::<Vec<_>>().len());

    println!("{}", length);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: i64
    };

    let mut ans = 1_000_000_000_000_000_i64;
    for a in 1..n {
        if a * a > n {
            break;
        }
        if n % a == 0 {
            let mut b = n / a;
            let mut c = 0;
            while b > 0 {
                b /= 10;
                c += 1;
            }
            ans = std::cmp::min(ans, c);
        }
    }
    println!("{}", ans);
}
//  [rust]
#[allow(unused_imports)]
use std::cmp::max;
#[allow(unused_imports)]
use std::fmt;
#[allow(unused_imports)]
use std::fmt::Debug;
#[allow(unused_imports)]
use std::io;
#[allow(unused_imports)]
use std::str::FromStr;

fn main() {
    // ver1
    // let n: usize = get_vec_input()[0];
    // let mut result_set: (i64, i64) = (i64::MAX, i64::MAX);
    // for i in 0..n {
    //     for j in 0..n {
    //         if i * j == n {
    //             let pre_digit = max(get_digit(result_set.0), get_digit(result_set.1));
    //             let cur_digit = max(get_digit(i as i64), get_digit(j as i64));
    //             if pre_digit > cur_digit {
    //                 result_set = (i as i64, j as i64);
    //             }
    //         }
    //     }
    // }

    // let result = max(get_digit(result_set.0), get_digit(result_set.1));
    // println!("{}", result);

    // ver2
    let mut n: usize = get_vec_input()[0];
    if n == 1 {
        println!("1");
        return;
    }
    let mut result_set: (i64, i64) = (1, 1);
    for i in 2..n + 1 {
        while n % i == 0 {
            if result_set.0 <= result_set.1 {
                result_set.0 *= i as i64;
            } else {
                result_set.1 *= i as i64;
            }
            n /= i;
        }
    }
    let result: i64;
    if result_set.0 >= result_set.1 {
        result = get_digit(result_set.0);
    } else {
        result = get_digit(result_set.1);
    }
    println!("{}", result);
}

#[allow(dead_code)]
fn get_digit(value: i64) -> i64 {
    let mut digit = 0i64;
    let mut value = value;
    while value != 0 {
        value /= 10;
        digit += 1;
    }
    digit
}

#[allow(dead_code)]
fn sum_digit2(value: String) -> u32 {
    return value.chars().fold(0u32, |a, b| a + b.to_digit(10).unwrap());
}

#[allow(dead_code)]
fn sum_digit(value: i64) -> i64 {
    if value < 10 {
        return value;
    }
    return sum_digit(value / 10) + value % 10;
}

#[allow(dead_code)]
fn update_max<T>(left: &mut T, right: T)
where
    T: std::cmp::Ord + std::clone::Clone,
{
    if *left < right {
        *left = right.clone();
    }
}

#[allow(dead_code)]
fn update_min<T>(left: &mut T, right: T)
where
    T: std::cmp::Ord + std::clone::Clone,
{
    if *left > right {
        *left = right.clone();
    }
}

#[allow(dead_code)]
fn get_vec_input<T>() -> Vec<T>
where
    T: FromStr,
    T::Err: Debug,
{
    let mut input = String::new();
    io::stdin()
        .read_line(&mut input)
        .expect("Failed to read line");
    let vec: Vec<T> = input
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();
    vec
}

#[allow(dead_code)]
fn get_tuple_input() -> (u64, f32) {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    let mut iter = s.trim().split_whitespace();
    let c: u64 = iter.next().unwrap().parse().unwrap();
    let n: f32 = iter.next().unwrap().parse().unwrap();
    (c, n)
}

#[allow(dead_code)]
fn get_string_input() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    s.trim().to_string()
}
//  [swift]
import CoreFoundation
let N = Int(readLine()!)!
var ans = 10
for i in 1...Int(sqrt(Double(N))) {
    if N % i == 0 {
        ans = min(String(N/i).characters.count, ans)
    }
}
print(ans)
//  [swift]
import Foundation

//素数判定する関数 ex:) primeJudge(32) -> true
func primeJudge(_ num: Int) -> Bool {
    var i = 2
    if num == 1 {
        return false
    }
    if num == 2 || num == 3{
        return true
    }
    
    for i in 2 ... Int(sqrt(Double(num))) {
        if num%i == 0 {
            return false
        }
    }
    return true
}

//約数列挙する関数 ex:) multiple(32) -> [1,2,4,8,16,32]
func factors(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    for i in 1 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            factorsArr.append(i)
            if num/i != i {
            factorsArr.append(num/i)
            }
        }
    }
    
    return factorsArr.sorted()
}
//指数を求める ex:) exponents(32,2) -> 5
func exponents(_ num1: Int, _ num2: Int) -> Int {
    if num2 == 1 {
        return 1
    }
    var count = 0
    var num1 = num1
    while num1.isMultiple(of: num2) {
        num1 /= num2
        count += 1
    }
    return count
}


//素因数分解1 役数と指数を連続で格納
func primeFactorization1(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
            factorsArr.append(i)
            factorsArr.append(exponents(num, i))
            }
        }
    }
    print(factorsArr)
    return factorsArr.sorted()
}

//素因数分解2 役数と指数を別の配列に格納
func primeFactorization2(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    var exponentsArr = [Int]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
            factorsArr.append(i)
            exponentsArr.append(exponents(num, i))
            }
        }
    }
    print(factorsArr)
    print(exponentsArr)
    return factorsArr.sorted()
}
//素因数分解3 役数と指数を二次元配列に格納
func primeFactorization3(_ num: Int) -> [[Int]] {
    var primeFactArr = [[Int]]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
                primeFactArr.append([i,exponents(num, i)])
            }
        }
    }
    return primeFactArr
}
primeFactorization3(150)
//桁数を返す関数
func numberOfDigits(_ num: Int) -> Int {
    var digits = 1
    var num = num
    while num >= 10 {
        num /= 10
        digits += 1
    }
    return digits
}


let rdInt = Int(readLine()!)!


func factors1(_ num: Int) -> Int {
    var factorsArr = [Int]()
    for i in 1 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            factorsArr.append(max(numberOfDigits(i),numberOfDigits(num/i)))
        }
    }
    
    return factorsArr.min()!
}

print(factors1(rdInt))
//  [swift]
import Foundation

//素数判定する関数 ex:) primeJudge(32) -> true
func primeJudge(_ num: Int) -> Bool {
    var i = 2
    if num == 1 {
        return false
    }
    if num == 2 || num == 3{
        return true
    }
    
    for i in 2 ... Int(sqrt(Double(num))) {
        if num%i == 0 {
            return false
        }
    }
    return true
}

//約数列挙する関数 ex:) multiple(32) -> [1,2,4,8,16,32]
func factors(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    for i in 1 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            factorsArr.append(i)
            if num/i != i {
            factorsArr.append(num/i)
            }
        }
    }
    
    return factorsArr.sorted()
}
//指数を求める ex:) exponents(32,2) -> 5
func exponents(_ num1: Int, _ num2: Int) -> Int {
    if num2 == 1 {
        return 1
    }
    var count = 0
    var num1 = num1
    while num1.isMultiple(of: num2) {
        num1 /= num2
        count += 1
    }
    return count
}


//素因数分解1 役数と指数を連続で格納
func primeFactorization1(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
            factorsArr.append(i)
            factorsArr.append(exponents(num, i))
            }
        }
    }
    print(factorsArr)
    return factorsArr.sorted()
}

//素因数分解2 役数と指数を別の配列に格納
func primeFactorization2(_ num: Int) -> [Int] {
    var factorsArr = [Int]()
    var exponentsArr = [Int]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
            factorsArr.append(i)
            exponentsArr.append(exponents(num, i))
            }
        }
    }
    print(factorsArr)
    print(exponentsArr)
    return factorsArr.sorted()
}
//素因数分解3 役数と指数を二次元配列に格納
func primeFactorization3(_ num: Int) -> [[Int]] {
    var primeFactArr = [[Int]]()
    for i in 2 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            if primeJudge(i) {
                primeFactArr.append([i,exponents(num, i)])
            }
        }
    }
    return primeFactArr
}
primeFactorization3(150)
//桁数を返す関数
func numberOfDigits(_ num: Int) -> Int {
    var digits = 1
    var num = num
    while num >= 10 {
        num /= 10
        digits += 1
    }
    return digits
}


let rdInt = Int(readLine()!)!


func factors1(_ num: Int) -> Int {
    var factorsArr = [Int]()
    for i in 1 ... Int(sqrt(Double(num))) {
        if num.isMultiple(of: i) {
            print(i,num/i)
            print(numberOfDigits(i),numberOfDigits(num/i))
            factorsArr.append(max(numberOfDigits(i),numberOfDigits(num/i)))
        }
    }
    print(factorsArr)
    
    return factorsArr.min()!
}

print(factors1(rdInt))
//  [swift]
import CoreFoundation
let N = Int(readLine()!)!
let divisors = (1...Int(sqrt(Double(N)))).filter{N % $0 == 0}
print(String(divisors[divisors.count-1]).characters.count)
//  [swift]
import CoreFoundation
let N = Int(readLine()!)!
let divisors = (1...Int(sqrt(Double(N)))!).filter{N % $0 == 0}
print(String(divisors[divisors.count-1]).characters.count)
//  [typescript]
"use strict";

const Main = args => {
  const input = args.trim() - 0;
  const max = Math.floor(Math.sqrt(input));

  let result = input.toString().length

  for (let a = 1; a <= max; a++) {
    if (input % a === 0) {
      let b = input / a;
      let tmp = Math.max(a.toString().length, b.toString().length);

      if (tmp < result) {
        result = tmp;
      }
    }
  }

  console.log(result);

}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]
"use strict";

const Main = args => {
  const input = args.trim() - 0;
  const max = Math.floor(Math.sqrt(input));

  let result = input.toString().length

  for (let a = 1; a < max; a++) {
    if (input % a === 0) {
      let b = input / a;
      let tmp = Math.max(a.toString().length, b.toString().length);

      if (tmp < result) {
        result = tmp;
      }
    }
  }

  console.log(result);

}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
# ABC081C - Not so Diverse (ARC086C)
from collections import Counter


def main():
    n, k = map(int, input().rstrip().split())
    A = sorted(Counter(input().split()).values(), reverse=True)
    print(sum(A[k:]))


if __name__ == "__main__":
    main()
//  [python]
from collections import Counter
n, k = map(int, input().split())
al = sorted(Counter(input().split()).values(), reverse=True)
print(sum(al[k:]))
//  [python]
# ARC086C - Not so Diverse (ABC081C)
from collections import Counter


def main():
    _, k, *a = map(int, open(0).read().split())
    print(sum(sorted(Counter(a).values(), reverse=True)[k:]))


if __name__ == "__main__":
    main()
//  [python]
import collections as c
N,K,*A= map(int,open(0).read().split())
ans=0
C=c.Counter(A)
C=sorted(C.values())

colors = len(C)

for i in range(colors):
  if len(C)<=K:
    break
  _c = C.pop(0)
  ans+=_c
print(ans)
//  [python]
import collections as c
N,K,*A= map(int,open(0).read().split())
ans=0
C=c.Counter(A)
C=sorted(C.values())

for i in range(N):
  if len(C)<=K:
    break
  ans+=C[i]
print(ans)
//  [python]
import collections as c
N,K,*A= map(int,open(0).read().split())
ans=0
C=c.Counter(A)
C=sorted(C.values(),key=lambda x:x)

for i in C:
  if len(C)<=K:
    break
  _c = C.pop(0)
  ans+=_c
print(ans)
//  [java]
import java.util.*;

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

        int n = sc.nextInt();
        int k  = sc.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            int count = map.getOrDefault(a,0);
            map.put(a, ++count);
        }

        if (map.size() <= k) {
            System.out.println(0);
        }

        int diff = map.size() - k ;
        List<Map.Entry<Integer, Integer>> list = new ArrayList<>(map.entrySet());
        list.sort((e1, e2) -> (e1.getValue() - e2.getValue()));
        int count = 0;
        for (int i = 0; i < diff; i++) {
            count += list.get(i).getValue();
        }

        System.out.println(count);
    }
}
//  [java]
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        HashMap<Long, Long> h = new HashMap<>();
        for (int i = 0; i < n; i++) {
            long a = Long.parseLong(sc.next());
            if (h.containsKey(a)) {
                h.put(a, h.get(a) + 1);
            } else {
                h.put(a, 1L);
            }
        }
        sc.close();
        h.entrySet().stream().sorted(Map.Entry.comparingByValue());
        long ans = 0, i = 0;
        for (long v : h.values()) {
            i++;
            if (i > k) {
                ans += v;
            }
        }
        System.out.println(ans);
    }
}
//  [java]
import java.util.*;
import java.util.stream.Collectors;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        HashMap<Long, Long> h = new HashMap<>();
        for (int i = 0; i < n; i++) {
            long a = Long.parseLong(sc.next());
            if (h.containsKey(a)) {
                h.put(a, h.get(a) + 1);
            } else {
                h.put(a, 1L);
            }
        }
        sc.close();
        List<Long> s = h.keySet().stream().collect(Collectors.toList());
        s.sort(Comparator.reverseOrder());
        long ans = 0, i = 0;
        for (long v : s) {
            i++;
            if (i > k) {
                ans += v;
            }
        }
        System.out.println(ans);
    }
}