qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math
n = int(input())
res = 10**10
for i in range(1, int(math.sqrt(n) + 1)):
  if(n % i == 0):
    tmp = max([len(str(i)), len(str(n//i))])
    print(i, len(str(i)),  n//i, len(str(n//i)))
    if(res > tmp):
      res = tmp
print(res)

Fixed code:
import math
n = int(input())
res = 10**10
for i in range(1, int(math.sqrt(n) + 1)):
  if(n % i == 0):
    tmp = max([len(str(i)), len(str(n//i))])
    if(res > tmp):
      res = tmp
print(res)
Buggy code:
n, m = int(input()), 0
for i in range(1, int(n**.5)+1):
    if not n%i%1:
        m = max(m, i)
print(len(str(n//m)))

Fixed code:
n, m = int(input()), 0
for i in range(1, int(n**.5)+1):
    if not n%i:
        m = max(m, i)
print(len(str(n//m)))
Buggy code:
from math import log10

N = int(input())

ans = int(log10(N)) + 1

for i in range(2, int(N ** 0.5) + 1):
    if N % i == 0:
        tmp = int(log10(N // i)) + 1
        if tmp < ans:
            ans = tmp
            print(tmp)

print(ans)

Fixed code:
from math import log10

N = int(input())

ans = int(log10(N)) + 1

for i in range(2, int(N ** 0.5) + 1):
    if N % i == 0:
        tmp = int(log10(N // i)) + 1
        if tmp < ans:
            ans = tmp

print(ans)
Buggy code:
N = int(input())
ans = 10
for i in range(1,N+1):
    if(N%i==0):
        a = i
        b = int(N/i)
        F = max(len(str(a)), len(str(b)))
        ans = min(ans, F)
print(ans)

Fixed code:
N = int(input())
ans = 10
for i in range(1,int(N**0.5)+1):
    if(N%i==0):
        a = i
        b = int(N/i)
        F = max(len(str(a)), len(str(b)))
        ans = min(ans, F)
print(ans)
Buggy code:
N = int(input())
A = []
for i in range(int(N**0.5)):
  if N%(i+1) == 0:
    A.append(i)
print(len(str(int(N/A[-1]))))


Fixed code:
N = int(input())
A = []
for i in range(int(N**0.5)):
  if N%(i+1) == 0:
    A.append(i+1)
print(len(str(int(N/A[-1]))))
Buggy code:
N=int(input())
n=len(str(N))
m=(n//2)+1
def wari(x):
    array=[]
    if m==0:
        for j in range(9,0,-1):
            if N%j==0:
                c=max(len(str(N//j)),len(str(j)))
                array.append(c)
                break
        
    for i in range(m+1):
        if i==0:
            for j in range(9,0,-1):
                if N%j==0:
                    c=max(len(str(N//j)),len(str(j)))
                    array.append(c)
                    break
        else:
            for j in range((10**(m+1))-1,(10**m)-1,-1):
                if N%j==0:
                    c=max(len(str(N//j)),len(str(j)))
                    array.append(c)
                    break
    return min(array)
print(wari(N))
        

Fixed code:
N=int(input())
n=len(str(N))
m=(n//2)
def wari(x):
    array=[]
    if m==0:
        for j in range(9,0,-1):
            if N%j==0:
                c=max(len(str(N//j)),len(str(j)))
                array.append(c)
                break
        
    for i in range(m+1):
        if i==0:
            for j in range(9,0,-1):
                if N%j==0:
                    c=max(len(str(N//j)),len(str(j)))
                    array.append(c)
                    break
        else:
            for j in range((10**(i+1))-1,(10**i)-1,-1):
                if N%j==0:
                    c=max(len(str(N//j)),len(str(j)))
                    array.append(c)
                    break
    return min(array)
print(wari(N))
Buggy code:
# -*- coding: utf-8 -*-
import math

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

tmp= math.ceil(math.sqrt(n))

for i in range(0,tmp):
	if(n%(tmp-i)==0):
		break

#print(tmp-i)
ansn=n//(tmp-i)
#print(ansn)
ans=math.floor(math.log10(ansn-1)) + 1

print(ans)



Fixed code:
# -*- coding: utf-8 -*-
import math

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

tmp= math.ceil(math.sqrt(n))
#print(n)
#print(tmp)
for i in range(0,tmp):
	if(n%(tmp-i)==0):
		break

#print(tmp-i)
ansn=n//(tmp-i)
#print(ansn)
#print(math.log10(ansn))
#print(max(ansn,tmp-i))
#print(math.floor(0.9))
ans=math.floor(math.log10(max(ansn,tmp-i))) + 1

print(ans)
Buggy code:
import math
N=int(input())
m=int(len(str(N)))
for j in range(2,math.int(sqrt(N))+1):
  a=j
  b=N//j
  m1=len(str(max(a,b)))
  m=min(m,m1)
print(m)

Fixed code:
import math
N=int(input())
m=int(len(str(N)))
for j in range(1,int(math.sqrt(N))+2):
    if N%j==0:
        a=j
        b=N//j
        m1=len(str(max(a,b)))
        m=min(m,m1)
print(m)
Buggy code:
N = int(input())
min_num = 10**5
for i in range(1, N+1):
  if N % i == 0:
    min_num = min(max(len(i), len(N//i)), min_num)
print(min_num)

Fixed code:
N = int(input())
min_num = 10**5
for i in range(1, 10**5+1):
    if N % i == 0:
        min_num = min(max(len(str(i)), len(str(N//i))), min_num)
print(min_num)
Buggy code:
N = int( input())
ans = len( str(N))
for i in range(1,int( N**(1/2))+1):
    if N%i == 0:
        ans = min( ans, max( len(i), len(N//i)))
        break
print(ans)

Fixed code:
N = int( input())
ans = len( str(N))
for i in range(1,int( N**(1/2))+1):
    if N%i == 0:
        ans = min( ans, max( len( str(i)), len( str(N//i))))
print(ans)
Buggy code:
N = int(input()) 
n = int(N**.5)
res = len(str(N))
print(n)
for i in range(2,n+1):
    if N % i == 0:
        #print(len(str(i)),len(str(N/i)))
        f = max(len(str(i)),len(str(N//i)))
        res = min(res, f)
#        print(i, len(str(i)),len(str(N/i)),res, f)
print(res)


Fixed code:
N = int(input()) 
n = int(N**.5)
res = len(str(N))
for i in range(2,n+1):
    if N % i == 0:
        #print(len(str(i)),len(str(N/i)))
        f = max(len(str(i)),len(str(N//i)))
        res = min(res, f)
#        print(i, len(str(i)),len(str(N/i)),res, f)
print(res)
Buggy code:
N = int(input())

def check(a, b):
    return max(len(str(a)), len(str(b)))

n = int(N ** (1/2))
#arr =[]
res = check(1, N)
print('first-res',res,n)
i = 1
while i <= n:
  if N % i == 0:
    res = min(res, check(i,int(N / i)))
#    print(res, i, N/i)
  i += 1

print(res)

Fixed code:
N = int(input())

def check(a, b):
    return max(len(str(a)), len(str(b)))

n = int(N ** (1/2))
#arr =[]
res = check(1, N)

i = 1
while i <= n:
  if N % i == 0:
    res = min(res, check(i,int(N / i)))
  i += 1

print(res)
Buggy code:
import math

N = int(input())
end = int(math.sqrt(N))+1
ans = len(str(N))

for a in range(1,end):
  if N%a == 0:
    b = N//i
    ans = min(ans, len(str(max(a,b)))
print(ans)


Fixed code:
N = int(input())

import math

end = int(math.sqrt(N))+1
ans = len(str(N))

for a in range(1,end):
  if N % a ==0:
    b = N//a
    ans = min(ans, len(str(max(a,b))))
print(ans)
Buggy code:
from math imoprt sqrt
n=int(input())
for i in range(int(sqrt(n)),0,-1):
  if n%i==0:
    print(max(len(str(i)),len(str(n//i))))
    exit()

Fixed code:
from math import sqrt
n=int(input())
for i in range(int(sqrt(n)),0,-1):
  if n%i==0:
    print(max(len(str(i)),len(str(n//i))))
    exit()
Buggy code:
n=int(input())
m=n**(1/2)//1+1
l=[]
for i in range(m+1)[:0:-1]:
  if n%i==0:
    l.append(max(len(str(i)),len(str(n//i))))
  if len(l)==3:
    break
print(min(l))

Fixed code:
n=int(input())
m=int((n**(1/2))//1+1)
l=[]
for i in list(range(m+1))[:0:-1]:
  if n%i==0:
    l.append(max(len(str(i)),len(str(n//i))))
  if len(l)==3:
    break
print(min(l))
Buggy code:
import math
N = int(input())
m = int(math.sqrt(N)+1)
print(m)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)

Fixed code:
import math
N = int(input())
m = int(math.sqrt(N)+1)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)
Buggy code:
N = int(input())
last = N
for num in range(1, N):
  if num**2 > N:
    print(len(str(last)))
    break
  elif num**2 == N:
    print(len(str(num)))
    break
  else
    if N%num == 0:
      last = N//num
    

Fixed code:
N = int(input())
last = N
for num in range(1, N+1):
  if num**2 > N:
    print(len(str(last)))
    break
  elif num**2 == N:
    print(len(str(num)))
    break
  else:
    if N%num == 0:
      last = N//num
Buggy code:
import math

def F(A, B):
    return max(list(map(int, [math.log10(A), math.log10(B)])))+1


def main():
    N = int(input())
    max_ = 0
    for a in range(1, int(math.sqrt(N))+1):
        if N % a != 0:
            continue

        b = N/a
        v = F(a, b)
        print(a, v)
        if max_ < v:
            max_ = v
    print(v)


if __name__ == '__main__':
    main()


Fixed code:
import math

def F(A, B):
    return max(list(map(int, [math.log10(A), math.log10(B)])))+1


def main():
    N = int(input())
    max_ = 0
    for a in range(1, int(math.sqrt(N))+1):
        if N % a != 0:
            continue

        b = N/a
        v = F(a, b)
        if max_ < v:
            max_ = v
    print(v)


if __name__ == '__main__':
    main()
Buggy code:
import math
from sys import exit, stdin
N = int(stdin.readline().rstrip())
N = int(math.sqrt(N))

ans = 0
for i in range(N, 0, -1):
    if N % i == 0:
        ans = N // i
        break
print(len(str(ans)))

Fixed code:
import math
from sys import exit, stdin
N = int(stdin.readline().rstrip())
ans = 0
for i in range(int(math.sqrt(N)), 0, -1):
    if N % i == 0:
        ans = N // i
        break
print(len(str(ans)))
Buggy code:
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N)+1)) :
    print(i)
    A = i
    B = int(N / A)
    if N % A == 0:
        print(A)
        print(B)
        if A > B :
            m = int(log10(A)) + 1
        else :
            m = int(log10(B)) + 1
            print(m)
        if m < ans :
            ans = m
        #print('{0},{1}'.format(A,B))
print(ans)


Fixed code:
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N))+1) :
    A = i
    B = int(N / A)
    if N % A == 0:
        if A >= B :
            m = int(log10(A)) + 1
        else :
            m = int(log10(B)) + 1
        if m < ans :
            ans = m
            #print(ans)
            #print('{0},{1}'.format(A,B))
print(ans)
Buggy code:
import math

N = int(input())
min_f = 10
for n in range(1, math.sqrt(N)):
    a = n
    if N % n != 0:
        continue
    b = N / n
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)

Fixed code:
import math

N = int(input())
min_f = 10
for n in range(1, int(math.sqrt(N)) + 1):
    a = n
    if N % n != 0:
        continue
    b = int(N / n)
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)
Buggy code:
import math
n=int(input())
x=math.floor(n)

while 1:
  if n % x ==0:
    break
  x-=1

print(max(len(str(int(n/x))),len(str(x))))

Fixed code:
import math
n=int(input())
x=math.floor(n**0.5)

while 1:
  if n % x ==0:
    break
  x-=1

print(max(len(str(int(n/x))),len(str(x))))
Buggy code:
# atcoder
import math

def get_number_of_digits(n):
    return int(math.log10(n) + 1)

def get_larger_digits(a, b):
    return max(get_number_of_digits(a), get_number_of_digits(b))

n = int(input())
min_digit = float('inf')
for a in range(1, n+1):
    if n % a != 0:
        continue
    b = int(n / a)
    if n == a * b:
        temp_digit = get_larger_digits(a, b)
        min_digit = min(min_digit, temp_digit)
print(min_digit)

Fixed code:
# atcoder
import math

def get_number_of_digits(n):
    return int(math.log10(n) + 1)

def get_larger_digits(a, b):
    return max(get_number_of_digits(a), get_number_of_digits(b))

n = int(input())
min_digit = float('inf')
for a in range(1, int(math.sqrt(float(n))+5.0)):
    if n % a != 0:
        continue
    b = int(n / a)
    if n == a * b:
        temp_digit = get_larger_digits(a, b)
        min_digit = min(min_digit, temp_digit)
print(min_digit)
Buggy code:
import math

n = int(input())

def compare_digits(a, b):
    return max(len(str(a)), len(str(b)))

ans_min = len(str(n))
for a in range(1, math.ceil(n / 2) + 1):
    if n % a == 0:
        ans = compare_digits(a, int(n / a))
        if ans < ans_min:
           ans_min = ans

print(ans_min)

Fixed code:
import math

n = int(input())

def compare_digits(a, b):
    return max(len(str(a)), len(str(b)))

ans_min = len(str(n))
for a in range(1, int(math.sqrt(n)) + 1):
    if n % a == 0:
        ans = compare_digits(a, int(n / a))
        if ans < ans_min:
           ans_min = ans

print(ans_min)
Buggy code:
n = int(input())
ele = []
i = 1
while i * i < n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
    i += 1

k = min(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)

Fixed code:
n = int(input())
ele = []
i = 1
while i * i <= n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
    i += 1

k = max(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)
Buggy code:
import sys
import copy
import string
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

li = make_divisors(ni())
ans = 10000000000000000
for i in range(len(li) // 2):
    f = max(len(str(li[i])), len(str(li[-(i+1)])))
    ans = min(f, ans)
if len(li) % 2 != 0:
    if len(li) == 1
        ans = 1
    else:
        ans = min(len(str(li[len(li)//2 + 1])), ans)
print(ans)


Fixed code:
import sys
import copy
import string
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = ni()
li = make_divisors(n)
ans = 10000000000000000
for i in range(len(li) // 2):
    if li[i] * li[-(i+1)] == n:
        f = max(len(str(li[i])), len(str(li[-(i+1)])))
        ans = min(f, ans)
if len(li) % 2 != 0:
    if len(li) == 1:
        ans = 1
    else:
        print()
        ans = min(len(str(li[len(li)//2])), ans)
print(ans)
Buggy code:
import math
N = int(input())
m = int(math.sqrt(N))
a = 0
ans = 0
count = 1

for i in range(m, 1, -1):
    if N % i == 0:
        a = i
        break

a = max(a, (N//a))

while True:
    if a >= 10:
        count += 1
        a = a// 10
    else:
        break
    
print(count)


Fixed code:
import math
N = int(input())
m = int(math.sqrt(N))
a = 0
ans = 0
count = 1

for i in range(1, m+1):
    if N % i == 0:
        a = i

a = max(a, (N//a))

while True:
    if a >= 10:
        count += 1
        a = a// 10
    else:
        break
    
print(count)
Buggy code:
N = int(input())
count = []

for a in range(1,N//2+1):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))

Fixed code:
N = int(input())
count = []

for a in range(1,int(N**0.5+1)):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))
Buggy code:
# -*- coding: utf-8 -*-
import sys
# from collections import defaultdict, deque
from math import log10, sqrt, ceil
def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline()[:-1]

def c(x):
    cnt = 0
    n = x
    while n:
        n //= 10
        cnt += 1
    return cnt

def solve():
    n = int(input())
    o = n
    ans = c(n)
    for i in range(2, ceil(sqrt(n)) + 1):
        while (n % i == 0):
            n //= i
            a = n
            b = o // a
            print(a,b)
            ans = min(ans, max(c(a), c(b)))
        if n == 1:
            break

    print(ans)
    
        




t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""
1 -> (1, 2) -> (2 ** 3, 3) -> (3, 1)
100000007
"""



Fixed code:
# -*- coding: utf-8 -*-
import sys
# from collections import defaultdict, deque
from math import log10, sqrt, ceil
def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline()[:-1]

def c(x):
    cnt = 0
    n = x
    while n:
        n //= 10
        cnt += 1
    return cnt

def solve():
    n = int(input())
    o = n
    ans = c(n)
    for i in range(2, int(sqrt(n)) + 3):
        if (n % i == 0):
            a = i
            b = o // a
            ans = min(ans, max(c(a), c(b)))
        if i > n:
            break

    print(ans)
    
        




t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""
1 -> (1, 2) -> (2 ** 3, 3) -> (3, 1)
100000007
"""
Buggy code:
# coding: utf-8
# Here your code



N = int(input())
result = len(str(N))

for i in range(1,int(pow(N,0.5))):
    if(N % i == 0):
        s = max(len(str(i)), len(str(N/i)))
        result = min(s,result)
print(result)




Fixed code:
# coding: utf-8
# Here your code



N = int(input())
result = len(str(N))

for i in range(1,int(pow(N,0.5)+1)):
    if(N % i == 0):
        s = max(len(str(i)), len(str(int(N/i))))
        result = min(s,result)
print(result)
Buggy code:
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors
 
N=int(input()) 
div = make_divisors(N)

A = div[-1]
B = N//A
print(max(len(str(A)),len(str(B))))

Fixed code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
    return divisors
 
N=int(input()) 
div = make_divisors(N)

A = div[-1]
B = N//A
print(max(len(str(A)),len(str(B))))
Buggy code:
N = int(input())

for i in range(math.ceil(math.sqrt(N)), 0, -1):
    if N % i == 0:
        print(len(str(N//i)))
        break

Fixed code:
import math
N = int(input())

for i in range(int(math.sqrt(N)), 0, -1):
    if N % i == 0:
        print(len(str(N//i)))
        break
Buggy code:
import math

N = int(input())
A = []
B = []
F = []
for i in range(1,N):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))


Fixed code:
import math

N = int(input())
A = []
B = []
F = []

for i in range(1,int(math.sqrt(N))+1,1):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))
Buggy code:
import numpy as np

n = int(input())
n_s = int(np.sqrt(n))

b = n_s
a = 1

for i in range(2, n_s+1):
  if n % i == 0:
    a = i
    b = n//i

print(int(max(np.log10(a), np.log10(b)))+1)

Fixed code:
import numpy as np
 
n = int(input())
n_s = int(np.sqrt(n))
 
b = n
a = 1
 
for i in range(2, n_s+1):
  if n % i == 0:
    a = i
    b = n//i
 
print(int(max(np.log10(a), np.log10(b)))+1)
Buggy code:
n = int(input())

def keta(r):
    cnt = 0
    while r:
        r//=10
        cnt+=1
    return cnt
ans = 1e10
for i in range (2,1000000000):
    if i * i > n :break
    if n%i !=0 :continue
    ans = min(ans,max(keta(n/i),keta(i)))
print(ans)



Fixed code:
n = int(input())

def keta(r):
    cnt = 0
    while r:
        r//=10
        cnt+=1
    return cnt
ans = 1e10
for i in range (1,1000000000):
    if i * i > n :break
    if n%i !=0 :continue
    ans = min(ans,max(keta(n/i),keta(i)))
print(ans)
Buggy code:
N = int(input())
A = 0
B = 0
num = 0
ans = 10**10

for i in range(1, N+1):
  if N%i == 0:
    A = len(str(i))
    B = len(str(N//i))
    num = max(A, B)
    ans = min(ans, num)
print(ans)

Fixed code:
N = int(input())
A = 0
B = 0
num = 0
ans = 10**10

for i in range(1, int((N)**(1/2)+1)):
  if N%i == 0:
    A = len(str(i))
    B = len(str(N//i))
    num = max(A, B)
    ans = min(ans, num)
print(ans)
Buggy code:
N = int(input())

i = 1
temp = 1
while temp ** 2 <= N:
    if N % temp == 0:
        i = N // temp
        temp += 1
    else:
        temp += 1

print(min(len(str(i)), len(str(N // i))))

Fixed code:
N = int(input())

i = 1
temp = 1
while temp ** 2 <= N:
    if N % temp == 0:
        i = N // temp
        temp += 1
    else:
        temp += 1

print(max(len(str(i)), len(str(N // i))))
Buggy code:
N = int(input())

def F(A, B):
    return max(len(str(A)), len(str(B)))

ans = 1000000000
for A in range(1, N+1):
    if N%A == 0:
        B = int(N / A)
        if F(A, B) < ans:
            ans = F(A, B)

print(ans)

Fixed code:
N = int(input())

def F(A, B):
    return max(len(str(A)), len(str(B)))

ans = 1000000000
half = int((N+1)**(1/2) + 1)
for A in range(1, half):
    if N%A == 0:
        B = int(N / A)
        if F(A, B) < ans:
            ans = F(A, B)

print(ans)
Buggy code:
n = int(input())

ab = []
ans = [1]
for i in range(1, int(n**(0.5))):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			
print(min(ans))


Fixed code:
n = int(input())

ab = []
ans = []
for i in range(1, int(n**(0.5))+1):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			
if len(ans) == 0:
	ans.append(1)

print(min(ans))
Buggy code:
N = int(input())

div = []
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        div.append([i, N // i])
print(div)

l = len(div)
flist = []
for i in range(l):
    fx = max([len(str(div[i][0])), len(str(div[i][1]))])
    flist.append(fx)

print(min(flist))


Fixed code:
N = int(input())

div = []
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        div.append([i, N // i])
#print(div)

l = len(div)
flist = []
for i in range(l):
    fx = max([len(str(div[i][0])), len(str(div[i][1]))])
    flist.append(fx)

print(min(flist))
Buggy code:
n = int(input())
for i in range(int(n**0.5),0,-1):
    if n%i == 0:
        a = max(i,n//i)
        print(int(math.log10(a))+1)
        break

Fixed code:
import math
n = int(input())
for i in range(int(n**0.5),0,-1):
    if n%i == 0:
        a = max(i,n//i)
        print(int(math.log10(a))+1)
        break
Buggy code:
# AtCoder
import math
N = int(input())
mi = float("inf")


def F(x, y):
    return max(len(str(x)), len(str(y)))


sq = math.floor(math.sqrt(N)+1)

for A in range(1, sq):
    if N % A:
        B = N // A
        mi = min(F(A, B), mi)
print(mi)


Fixed code:
# AtCoder
import math
N = int(input())
mi = float("inf")


def F(x, y):
    return max(len(str(x)), len(str(y)))


sq = math.floor(math.sqrt(N)+1)

for A in range(1, sq):
    if N % A == 0:
        B = N // A
        mi = min(F(A, B), mi)
print(mi)
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  5 17:48:45 2019

@author: yuta
"""
import math
N = int(input())

def main(n):
    sqrt_n = math.sqrt(n)
    min_keta = len(str(n))
    for i in range(1,(int(sqrt_n)+1)):
        if n % i == 0:
            c = len(str(max(i,n/i)))
            if c < min_keta:
                min_keta = c
    print(min_keta)
main(N)

Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  5 17:48:45 2019

@author: yuta
"""
import math
N = int(input())

def main(n):
    sqrt_n = math.sqrt(n)
    min_keta = len(str(n))
    for i in range(1,int(sqrt_n)+1):
        if n % i == 0:
            j = int(n/i)
            max_num = max(i,j)
            c = len(str(max_num))
            if c < min_keta:
                min_keta = c
    print(min_keta)
main(N)