Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import bisect
import copy

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===


def main():
    n, k = ns()
    a = na()

    d = []
    for i in range(n):
        tmp = a[i]
        d.append(tmp)
        for j in range(i + 1, n):
            tmp += a[j]
            d.append(tmp)

    def maxbit(a, idx, k):
        first1 = [[] for _ in range(41)]
        for ai in a:
            for i in range(40, -1, -1):
                if ai >> i & 1:
                    first1[i].append(ai)

        for i in range(idx - 1, -1, -1):
            if len(first1[i]) >= k:
                return first1[i], i

        return first1[idx], -1

    idx = 40
    while True:
        tmp, idx = maxbit(d, idx, k)
        if idx == -1:
            break
        d = tmp

    bit1 = [0 for _ in range(41)]
    for di in d:
        for i in range(41):
            if di >> i & 1:
                bit1[i] += 1

    ans = 0
    for i, bi in enumerate(bit1):
        if bi >= k:
            ans += pow(2, i)

    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
import sys
import math
import collections
import bisect
import copy

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===


def main():
    n, k = ns()
    a = na()

    d = []
    for i in range(n):
        tmp = a[i]
        d.append(tmp)
        for j in range(i + 1, n):
            tmp += a[j]
            d.append(tmp)

    def maxbit(a, idx, k):
        first1 = [[] for _ in range(41)]
        for ai in a:
            for i in range(40, -1, -1):
                if ai >> i & 1:
                    first1[i].append(ai)

        for i in range(idx - 1, -1, -1):
            if len(first1[i]) >= k:
                return first1[i], i

        return first1[idx], -1

    idx = 40
    while True:
        tmp, idx = maxbit(d, idx, k)
        if idx == -1:
            break
        d = tmp

    bit1 = [0 for _ in range(41)]
    for di in d:
        for i in range(41):
            if di >> i & 1:
                bit1[i] += 1

    ans = 0
    for i, bi in enumerate(bit1):
        if bi >= k:
            ans += pow(2, i)

    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if a == 1:
    print("Hello World")
    
elif a == 2:
    inputb = input().split()
    inputc = input().split()

b = int(inputb[0])
c = int(inputc[0])

print(b + c)

Fixed submission:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if a == 1:
    print("Hello World")

elif a == 2:
    inputb = input().split()
    inputc = input().split()

    b = int(inputb[0])
    c = int(inputc[0])
    
    print(b + c)
Buggy python submission (verdict: Runtime Error):
import sys
# import math
# import bisect
import numpy as np


# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

# ===CODE===
def main():
    n,m,q = map(int,input().split())
    ruisekiwa_s = [0 for _ in range(n+1)]
    ruisekiwa_t = [0 for _ in range(n+1)]
    for _ in range(m):
        l,r = map(int, input().split())
        ruisekiwa_s[l]+=1
        ruisekiwa_t[r]+=1

    for i in range(1, n+1):
        ruisekiwa_s[i] += ruisekiwa_s[i-1]
        ruisekiwa_t[i] += ruisekiwa_t[i-1]

    for _ in range(q):
        s,t = map(int,input().split())
        ans = ruisekiwa_t[t] - ruisekiwa_s[s-1]
        print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
import sys


# import math
# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

# ===CODE===
def main():
    n, m, z = map(int, input().split())
    ruisekiwa = [[0 for i in range(n + 1)] for j in range(n + 1)]

    d = []
    for i in range(m):
        l, r = map(int, input().split())
        ruisekiwa[r][l] += 1

    for i in range(n):
        for j in range(n):
            ruisekiwa[i + 1][j + 1] += ruisekiwa[i][j + 1] + ruisekiwa[i + 1][j] - ruisekiwa[i][j]

    for _ in range(z):
        p, q = map(int, sys.stdin.readline().split())
        ans = ruisekiwa[q][q] - ruisekiwa[p - 1][q] - ruisekiwa[q][p - 1] + ruisekiwa[p - 1][p - 1]
        print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

ans(a*2)


Fixed submission:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if a%2 == 0:
    print(a)
else:
    print(a*2)

Buggy python submission (verdict: Runtime Error):
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

inputa = [int(n) for n in inputa]
inputa.sort()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

ans(a*2)


Fixed submission:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if a%2 == 0:
    print(a)
else:
    print(a*2)
Buggy python submission (verdict: Runtime Error):
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

# inputa = list(inputa[0])

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")
    


Fixed submission:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

# inputa = [int(n) for n in inputa]
# inputa.sort()

# inputa = list(inputa[0])

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if a <= 8 and b <= 8:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
import math
import copy
import sys


inputa = input().split()
inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

if a == 0:
    print(b)
else:
    ans = a * 100 * b
    print(ans)




Fixed submission:
import math
import copy
import sys


inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

if b == 100:
    ans = pow(100, a) * (b + 1)
else:
    ans = pow(100, a) * b
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    n = ni()
    mat = [list(sys.stdin.readline()) for _ in range(n)]

    ans = 0
    for i in range(n):
        tmp = [[mati[(i + j) % n] for j in range(n)] for mati in mat]
        flg = True
        for y in range(n):
            for x in range(n):
                if tmp[y][x] != tmp[x][y]:
                    flg = False
        ans += flg * n
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    n = ni()
    mat = [list(sys.stdin.readline()) for _ in range(n)]

    ans = 0
    for i in range(n):
        tmp = [[mati[(i + j) % n] for j in range(n)] for mati in mat]
        flg = True
        for y in range(n):
            for x in range(n):
                if tmp[y][x] != tmp[x][y]:
                    flg = False
        ans += flg * n
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

# import math
# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    d = na()

    for i in range(n):
        tmp_d = d[:i] + d[i + 1:]
        tmp_d.sort()
        print(tmp_d[n // 2 - 1])


if __name__ == '__main__':
    main()


Fixed submission:
import sys

# import math
# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    d = na()

    tmp_d = sorted(d)

    front = tmp_d[n//2-1]
    rear = tmp_d[n//2]

    for num in d:

        if front>=num:
            print(rear)
        else:
            print(front)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

# import math
# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    d = na()

    for i in range(n):
        tmp_d = d[:i] + d[i + 1:]
        tmp_d.sort()
        print(tmp_d[n // 2 - 1])


if __name__ == '__main__':
    main()


Fixed submission:
import sys

# import math
# import bisect

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    d = na()

    tmp_d = sorted(d)

    front = tmp_d[n//2-1]
    rear = tmp_d[n//2]

    for num in d:

        if front>=num:
            print(rear)
        else:
            print(front)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
import copy
import sys
import fractions
# import numpy as np
# import statistics
import decimal
import heapq
import collections
import itertools
import bisect


# from operator import mul

# sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())
a = getInputIntList()
b = getInputIntList()
c = getInputIntList()

a.sort()
b.sort()
c.sort()

ans = 0
for i in range(n):
    x = bisect.bisect_left(b, c[i])
    for j in range(x-1, -1, -1):
        y = bisect.bisect_left(a, b[j])
        ans += y

print(ans)
















Fixed submission:
import math
import copy
import sys
import fractions
# import numpy as np
# import statistics
import decimal
import heapq
import collections
import itertools
import bisect


# from operator import mul

# sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputIntList():
    outputDataList = []
    inputData = input().split()
    outputDataList = [int(n) for n in inputData]

    return outputDataList

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())
a = getInputIntList()
b = getInputIntList()
c = getInputIntList()

a.sort()
b.sort()
c.sort()

ans = 0
for tmp in b:
    top = bisect.bisect_left(a, tmp)
    bottom = bisect.bisect_right(c, tmp)
    ans += top * (n-bottom)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    N = ni()
    lim = 3500

    for h in range(1, lim + 1):
        for n in range(1, lim + 1):
            up = N * h * n
            down = 4 * h * n - N * n - N * h
            if down != 0:
                if up % down == 0:
                    if 0 < up // down:
                        print(h, n, up // down)
                        exit(0)


if __name__ == '__main__':
    main()


Fixed submission:
import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    N = ni()
    lim = 3500

    for h in range(1, lim + 1):
        for n in range(1, lim + 1):
            up = N * h * n
            down = 4 * h * n - N * n - N * h
            if down != 0:
                if up % down == 0:
                    if 0 < up // down:
                        print(h, n, up // down)
                        exit(0)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions

import copy

# import heapq
# from collections import deque
# import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    n = ni()
    p = na()

    cnt=0
    for i in range(1, n+1):
        if p[i - 1] == i:
            p[i - 1], p[i] = p[i], p[i - 1]
            cnt+=1
    print(cnt)

if __name__ == '__main__':
    main()


Fixed submission:
import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions

import copy

# import heapq
# from collections import deque
# import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===

def main():
    n = ni()
    p = na()

    cnt = 0
    for i in range(1, n + 1):
        if i<n:
            if p[i - 1] == i:
                p[i - 1], p[i] = p[i], p[i - 1]
                cnt += 1
        else:
            if p[i - 1] == i:
                p[i - 1], p[i-2] = p[i-1], p[i - 2]
                cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    k = ni()
    l = 2
    upper = 10 ** 16 + 1000
    lower = 0
    ans = [0 for _ in range(l)]
    ans[1] = (k % 2) ^ 1

    while True:
        middle = (upper + lower) // 2
        t_mid = middle
        t_ans = [0 for _ in range(l)]
        t_ans[0] = middle
        t_ans[1] = (k % 2) ^ 1

        cnt = 0
        while max(t_ans) >= l:
            for i in range(l):
                if t_ans[i] >= l:
                    div = t_ans[i] // l
                    cnt += div
                    t_ans[i] = t_ans[i] % l

                    for j in range(l):
                        if i != j:
                            t_ans[j] += div
        if cnt == k:
            ans[0] = middle
            break
        elif cnt < k:
            lower = middle
        elif cnt > k:
            upper = middle

    print(l)
    print(*ans, sep=" ")


if __name__ == '__main__':
    main()


Fixed submission:
import sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

def main():
    k = ni()
    l = 50
    ans = [l - 1 for _ in range(l)]

    for i in range(l):
        ans[i] += k // l

    for i in range(l):
        tgt = k % l
        if i < tgt:
            ans[i] += l
            ans[i] -= tgt - 1
        else:
            ans[i] -= tgt

    print(l)
    print(*ans, sep=" ")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

ans = sys.maxsize
for i in range(1, math.sqrt(n)+1, 1):
    if n % i == 0:
        b = n//i
        tmp_ans = max(len(str(i)), len(str(b)))
        ans = min(ans, tmp_ans)

print(ans)



Fixed submission:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

ans = sys.maxsize
for i in range(1, int(math.sqrt(n))+1, 1):
    if n % i == 0:
        b = n//i
        tmp_ans = max(len(str(i)), len(str(b)))
        ans = min(ans, tmp_ans)

print(ans)