Harryxun/stf_run huggingface dataset:
n = int(input())
if n < 11 or n == 12 or n == 14 or n == 15 or n == 16 or n == 18 or n == 20 or n == 24 or n == 25  or n == 27  or n == 28   or n == 30  or n == 32  or n == 35  or n == 36  or n == 40  or n == 42   or n == 45  or n == 48  or n == 49   or n == 54   or n == 56   or n == 64   or n == 72   or n == 81  :
  print('Yes')
  eixt()
print('No')

### FIXED CODE ###

n = int(input())
if n < 11 or n == 12 or n == 14 or n == 15 or n == 16 or n == 18 or n == 20 or n == 21 or n == 24 or n == 25  or n == 27  or n == 28   or n == 30  or n == 32  or n == 35  or n == 36  or n == 40  or n == 42   or n == 45  or n == 48  or n == 49   or n == 54   or n == 56 or n == 63    or n == 64   or n == 72   or n == 81  :
  print('Yes')
  exit()
print('No')
import collections

n = int(input())
s = [input() for i in range(n)]

counter = collections.Counter(s)
ans = []
for i in range(n):
    if counter.most_common()[i][1] == counter.most_common()[0][1]:
        ans.append(counter.most_common()[i][0])
    else:
        break
ans.sort()
for i in ans:
    print(i)

### FIXED CODE ###

import collections
 
n = int(input())
s = [input() for i in range(n)]
 
counter = collections.Counter(s)
most = counter.most_common()
ans = []
for i in range(len(counter.keys())):
    if most[i][1] == most[0][1]:
        ans.append(most[i][0])
    else:
        break
ans.sort()
for i in ans:
    print(i)
n = int(input())
a = list(map(int, input().split()))
counter = [0 for _ in range(n)]
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        else:
            if counter[i] > 0:
                continue
            else:
                if a[i] % a[j] == 0:
                    counter[i] += 1:
print(counter.count(0))

### FIXED CODE ###

import numpy as np
 
n = int(input())
a = list(map(int, input().split()))
a.sort()
dp = [0 for _ in range(a[-1] + 1)]

for x in a:
    for j in range(x, a[-1] + 1, x):
        dp[j] += 1
ans = 0
for x in set(a):
    #print(x)
    if dp[x] == 1:
        ans += 1
print(ans)
l,r=map(int,input().split())
lst=list(range(l,r+1))
modlist=[]
for i in lst:
	q,mod = divmod(i,2019)
	modlist.append(mod)
sor = sorted(modlist)
print(sor[0]*sor[1])

### FIXED CODE ###

l,r=map(int,input().split())
if r-l+1<=2019:
	modlist=[]
	lst=list(range(l,r+1))
	for i in range(len(lst)):
		for j in range(i+1,len(lst)):
			q,mod = divmod(lst[i]*lst[j],2019)
			modlist.append(mod)
	print(min(modlist))
else:
	print(0)
import collections
def main():

    N, M, Q = map(int, input().split())
    p = collections.defaultdict(int)
    for _ in range(Q):
        a, b, c, d = map(int, input().split())
        p[(a-1, b-1, c)] = d

    lv = [[1]]
    for i in range(M):
        temp = []
        for v in lv:
            for j in range(v[-1], M+1):
                temp.append(v + [j])
        lv = temp

    ans = 0
    for v in lv:
        q = 0
        for a, b, c in p:
            if v[b] - v[a] == c:
                q += p[(a, b, c)]
        ans = max(ans, q)
    return ans



if __name__ == '__main__':
    print(main())


### FIXED CODE ###

import collections
def main():

    N, M, Q = map(int, input().split())
    p = collections.defaultdict(int)
    for _ in range(Q):
        a, b, c, d = map(int, input().split())
        p[(a-1, b-1, c)] = d

    lv = [[1]]
    for i in range(N):
        temp = []
        for v in lv:
            for j in range(v[-1], M+1):
                temp.append(v + [j])
        lv = temp

    ans = 0
    for v in lv:
        q = 0
        for a, b, c in p:
            if v[b] - v[a] == c:
                q += p[(a, b, c)]
        ans = max(ans, q)
    return ans

if __name__ == '__main__':
    print(main())
K = int(input())
R = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(R[K])

### FIXED CODE ###

K = int(input())
K = K - 1
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[K])
# -*- coding: utf-8 -*-

def gcd(a,b):
    if b==0:return a
    return gcd(b,a%b)


n = int(input())

a = (list(map(int, input().split())))

if n==2:
    print(max(a))
    exit()
'''
L = [gcd(a[0], a[1])]
R = [gcd(a[n-2], a[n-1])]
'''
#L = [0 for i in range(n+1)]
#R = [0 for i in range(n+1)]
L = [0]
R = [0]
for i in range(1,n+1):
    L.append(gcd(L[i-1], a[i-1]))

for i in range(n)[::-1]:
    R.append(gcd(R[i+1], a[i]))

#m = [0 for i in range(n)]
m = []
for i in range(n):
    m.append(gcd(L[i], R[i+1]))

print(max(m))


### FIXED CODE ###

# -*- coding: utf-8 -*-

a, b, t = map(int, input().split())

tt=t+0.5

print((int)(tt/a)*b)
n = int(input())
a = list(map(int,input().split()))
x = 1
for num in range(n):
    x  *= a[num]
    if x > 10**18:
        print(-1)
        sys.exit()
print(x)



### FIXED CODE ###

import sys
n = int(input())
a = list(map(int,input().split()))
x = 1
if 0 in a:
    print(0)
    sys.exit()
for num in range(n):
    x  *= a[num]
    if x > 10**18:
        print(-1)
        sys.exit()
print(x)
w,h,n=map(int,input().split())
record=[]
xmin=[]
xmax=[]
ymin=[]
ymax=[]
for i in range(n):
    x,y,a=list(map(int,input().split()))
    record.append([x,y,a])
for i in range(n):
    if record[i][2] == 1:
        xmin.append(record[i][0])
    elif record[i][2] == 2:
        xmax.append(record[i][0])
    elif record[i][2] == 3:
        ymin.append(record[i][1])
    else:
        ymax.append(record[i][1])
X=min(xmax)-max(xmin)
Y=min(ymax)-max(ymin)
print(X*Y) if (X > 0 and Y > 0) else print(0) 


### FIXED CODE ###

w,h,n=map(int,input().split())
record=[]
xmin=[]
xmax=[]
ymin=[]
ymax=[]

for i in range(n):
    x,y,a=list(map(int,input().split()))
    record.append([x,y,a])
    
for i in range(n):
    if record[i][2] == 1:
        xmin.append(record[i][0])
    elif record[i][2] == 2:
        xmax.append(record[i][0])
    elif record[i][2] == 3:
        ymin.append(record[i][1])
    else:
        ymax.append(record[i][1])

if xmax==[] and xmin==[]:
    X=w
elif xmax==[]:
    X=w-max(xmin)
elif xmin==[]:
    X=min(xmax)-0
else:
    X=min(xmax)-max(xmin)

if ymax==[] and ymin==[]:
    Y=h
elif ymax==[]:
    Y=h-max(ymin)
elif ymin==[]:
    Y=min(ymax)-0
else:
    Y=min(ymax)-max(ymin)
    
print(X*Y) if (X > 0 and Y > 0) else print(0)
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n,m,k = readInts()
A = readInts()
B = readInts()
A = [0] + list(accumulate(A))
B = list(accumulate(B))
ans = 0
for i in range(len(A)):
    res = A[i]
    print('res:',A[i])
    print(B)
    r = bisect.bisect_right(B, k-res+1)
    print(r,'\n - - -\n')
    #print(i,r)
    if res <= k:
        ans = max(ans , i+r)
print(ans)


### FIXED CODE ###

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,m,k = readInts()
A = [0] + list(accumulate(readInts()))
B = list(accumulate(readInts()))
ans = 0
import bisect
#print(B)
for i in range(len(A)):
    if A[i] > k:
        continue
    x = bisect.bisect_left(B,k - A[i] + 1)
    #print(x,)
    ans = max(ans,x+i)
print(ans)
#coding: utf-8
import numpy as np
n = int(input())
water = list(map(int,input().split()))

A = np.identity(n)
A += np.eye(n, k=1)
A[n-1][0] = 1

ans = np.linalg.solve(0.5*A,water)
print(" ".join(list(map(lambda x:str(int(x)),ans))))


### FIXED CODE ###

#coding: utf-8
n = int(input())
water = list(map(int,input().split()))

sum_water = sum(water)
r_1 = sum_water
for i in range(1,int((n-1)/2+1)):
    r_1 -= water[2*i-1]*2
    #print(water[2*i])

ans = [r_1]
for i in range(n-1):
    ans.append(water[i]*2-ans[-1])
    #print(ans)

print(" ".join(map(lambda x:str(int(x)),ans)))
N = int(input())
B = list(map(int, input().split()))

ans = 0
for i in range(N):
	ans += min([A[i], A[i+1]])

ans += A[N-1]

print(ans)


### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))

ans = B[0]

for i in range(N-2):
	ans += min([B[i], B[i+1]])

ans += B[N-2]

print(ans)
import sys
import numpy as np
input = sys.stdin.readline

def main():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for i in range(N)]

    base_w = wv[0][0]
    dic = {wv[0][0]:[], wv[0][0]+1:[], wv[0][0]+2:[], wv[0][0]+3:[]}
    for i in range(N):
        w, v = wv[i]
        dic[w].append(v)
    
    wv = list(dic.items())
    tmp = [[0] for i in range(4)]
    for i in range(4):
        num, l = wv[i]
        l = sorted(l, reverse=True)
        for j in range(1, len(l)):
            l[j] += l[j-1]
        tmp[i] += l


    ans = 0
    for i in range(len(tmp[0])):
        now_w = base_w * i
        # if now_w > W:
        #     break
        for j in range(len(tmp[1])):
            now_w1 = now_w + (base_w + 1) * j
            # if now_w > W:
            #     break
            for k in range(len(tmp[2])):
                now_w2 = now_w1 + (base_w + 2) * k
                # if now_w > W:
                #     break
                for l in range(len(tmp[3])):
                    now_w3 = now_w2 + (base_w + 3) * l
                    if now_w3 > W:
                        break
                    else:
                        val = tmp[0][i] + tmp[1][j] + tmp[2][k] + tmp[3][l]
                        if ans < val:
                            ans = val
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for i in range(N)]

    base_w = wv[0][0]
    dic = {wv[0][0]:[], wv[0][0]+1:[], wv[0][0]+2:[], wv[0][0]+3:[]}
    for i in range(N):
        w, v = wv[i]
        dic[w].append(v)
    
    wv = sorted(list(dic.items()))
    tmp = [None for i in range(4)]
    for i in range(4):
        num, l = wv[i]
        l = sorted(l, reverse=True)
        for j in range(1, len(l)):
            l[j] += l[j-1]
        tmp[i] = [0] + l

    # for i in range(4):
    #     print(tmp[i][:10])

    ans = 0
    for i in range(len(tmp[0])):
        for j in range(len(tmp[1])):
            for k in range(len(tmp[2])):
                for l in range(len(tmp[3])):
                    weight = base_w * i + (base_w + 1) * j + (base_w + 2) * k + (base_w + 3) * l
                    if weight <= W:
                        val = tmp[0][i] + tmp[1][j] + tmp[2][k] + tmp[3][l]
                        if ans < val:
                            ans = val
    print(ans)

if __name__ == "__main__":
    main()
class Solution:

    def solve(self, N: int, M: int) -> int:

        mod = 10**9+7
        INT_MAX = 10**9

        # calculate {m+n}C{n}

        def egcd(a, b):
            if a == 0:
                return b, 0, 1
            else:
                g, y, x = egcd(b % a, a)
                return g, x - (b // a) * y, y

        def modinv(a, m):
            g, x, y = egcd(a, m)
            if g != 1:
                raise Exception('modular inverse does not exist')
            else:
                return x % m

        def combination(n: int, r: int, mod: int = 10**9+7) -> int:
            r = min(r, n-r)
            res = 1
            for i in range(r):
                res = res * (n-i) * modinv(i+1, mod) % mod
            return res

        # prime list

        isPrime = [True] * (INT_MAX + 1)
        isPrime[0], isPrime[1] = False, False
        primes = []

        for i in range(2, len(isPrime)):
            if isPrime[i] == True:
                primes.append(i)
                for j in range(2 * i, len(isPrime), i):
                    isPrime[j] = False

        # solve

        m = M
        answer = 1
        factors = {}
        while m > 1:
            for p in primes:
                factors[p] = 0

                while m % p == 0:
                    m //= p
                    factors[p] += 1

                if factors[p] > 0:
                    answer *= combination(N + factors[p] - 1, N - 1, mod=mod)
                    answer %= mod

        return answer


if __name__ == '__main__':

    # standard input
    N, M = map(int, input().split())

    # solve
    solution = Solution()
    print(solution.solve(N, M))


### FIXED CODE ###

import math


class Solution:

    def solve(self, N: int, M: int) -> int:

        mod = 10**9+7
        INT_MAX = 10**9

        # calculate {m+n}C{n}

        def egcd(a, b):
            if a == 0:
                return b, 0, 1
            else:
                g, y, x = egcd(b % a, a)
                return g, x - (b // a) * y, y

        def modinv(a, m):
            g, x, y = egcd(a, m)
            if g != 1:
                raise Exception('modular inverse does not exist')
            else:
                return x % m

        def combination(n: int, r: int, mod: int = 10**9+7) -> int:
            r = min(r, n-r)
            res = 1
            for i in range(r):
                res = res * (n-i) * modinv(i+1, mod) % mod
            return res

        # solve

        m = M
        answer = 1
        factors = {}
        for i in range(2, int(math.sqrt(M))+1):
            factor = 0
            while m % i == 0:
                m //= i
                factor += 1

            if factor > 0:
                answer *= combination(N + factor - 1, N - 1, mod=mod)
                answer %= mod

        if m > 1:
            answer *= N
            answer %= mod

        return answer


if __name__ == '__main__':

    # standard input
    N, M = map(int, input().split())

    # solve
    solution = Solution()
    print(solution.solve(N, M))
X = int(input())

l = range(-10**3:10**3)

for i in l:
  for j in l:
    if i**5 - j**5 == X:
      print("i" + " " + "j")
      exit()

### FIXED CODE ###

X = int(input())

l = range(-10**3,10**3)

for i in l:
  for j in l:
    if i**5 - j**5 == X:
      print(str(i) + " " + str(j))
      exit()
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    left = [A[0]] * N
    right = [A[-1]] * N

    for i in range(1,N):
        left[i] = max(A[i], left[i-1])
    for i in reversed(range(0,N-1)):
        right[i] = max(A[i], right[i+i])

    for i in range(N):
        if i == 0:
            print(right[1])
        elif i == N-1:
            print(left[N-2])
        else:
            print(max(left[i-1], right[i+1]))


    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    ml = A.copy()
    ml.sort(reverse=True)

    Am = ml[0]
    As = ml[1]

    for i in range(N):
        if(A[i] == Am):
            print(As)
        else:
            print(Am)
    

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
import math
 
H, W = list(map(int, input().split()))

# H, W = 4, 6
board = []
L = [[0 for i in range(W)] for i in range(H)]
R = [[0 for i in range(W)] for i in range(H)]
U = [[0 for i in range(W)] for i in range(H)]
D = [[0 for i in range(W)] for i in range(H)]

# board = [['#', '.', '.', '#', '.', '.'], ['.', '.', '.', '.', '.', '#'], ['.', '.', '.', '.', '#', '.'], ['#', '.', '#', '.', '.', '.']]

# insert elements to the board
for i in range(H):
	a = list(input())
	board.append(a)


# high_score is output values
high_score = 0
	
# round robin
for h in range(H):
	for w in range(W):
		# print(h, w)
		# board put light is envolved
		score = 1
		# if not obstacle in board[h][w]
		if board[h][w] != "#":
			# DOWN
			for i in range(1, H):
				if h + i == W:
					break
				elif board[h + i][w] == "#":
					break
			score += i - 1
			D[h][w] = i - 1
			# print(D[h][w])
			
			# UP
			if h == 0 or board[h - 1][w] == "#":
				U[h][w] = 0
			else:
				U[h][w] = U[h - 1][w] + 1
			score += U[h][w]
			# print(U[h][w])
			
			# RIGHT
			for i in range(1, W):
				if w + i == W:
					break
				elif board[h][w + i] == "#":
					break
			score += i - 1
			R[h][w] = i - 1
			# print(R[h][w])
			
			# LEFT
			if w == 0 or board[h][w - 1] == "#":
				L[h][w] = 0
			else:
				L[h][w] = L[h][w - 1] + 1
			score += L[h][w]
			# print(L[h][w])
			
			# print(score)
			if score > high_score:
				high_score = score
				
print(high_score)

### FIXED CODE ###

H, W = map(int, input().split())

# 上下左右に余分に1マスとっとく
square = [[0 for _ in range(W)] for _ in range(H)]

for row in range(H):
	S = list(map(str, input()))
	for column in range(W):
		if S[column] == "#":
			# 下駄をはかせるの忘れない
			square[row][column] = -1
			
for row in range(H):
	done = [False for _ in range(W)]
	for column in range(W):
		if square[row][column] == -1: continue
		if done[column]: continue
		l = 1
		while column + l <= W - 1:
			if square[row][column + l] == -1: break
			l += 1
		for i in range(column, column + l):
			square[row][i] += l
			done[i] = True
			
for column in range(W):
	done = [False for _ in range(H)]
	for row in range(H):
		if square[row][column] == -1: continue
		if done[row]: continue
		l = 1
		while row + l <= H - 1:
			if square[row + l][column] == -1: break
			l += 1
		for i in range(row, row + l):
			square[i][column] += l
			done[i] = True

ret = 0			
for row in range(H):
	for column in range(W):
		ret = max(ret, square[row][column] - 1)
		
		
print(ret)
S = input()
a = S.count("a")
b = S.count("b")
c = S.count("c")

if abs(a-b) <= 1 and abs(a-c) <= 1 and abs(b-c) <= 1:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

S = input()
a = S.count("a")
b = S.count("b")
c = S.count("c")

if abs(a-b) <= 1 and abs(a-c) <= 1 and abs(b-c) <= 1:
  print("YES")
else:
  print("NO")
a,b,c=map(int,input().split())
if b-a=c-b:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
if b-a==c-b:
  print("YES")
else:
  print("NO")
N = int(input())
s = [(i+1, N-i-1) for i in range((N-1) // 2)]
ss = [sum(list(map(int,list(str(v[0])[::1])))) + sum(list(map(int,list(str(v[1])[::1])))) for v in s]
print(min(ss))

### FIXED CODE ###

N = int(input())
s = [(i+1, N-i-1) for i in range((N-1) // 2 + 1)]
ss = [sum(list(map(int,list(str(v[0])[::1])))) + sum(list(map(int,list(str(v[1])[::1])))) for v in s]
print(min(ss))
def split(word): 
    return [char for char in word]  
inp=input()
list=split(inp)
count=0
x=1
str="Good"
for i in range(len(3):
    if list[count]==list[count+1]:
        str="Bad"
    count=count+1
print(str)

### FIXED CODE ###

def split(word): 
    return [char for char in word]  
inp=input()
list=split(inp)
count=0
x=1
str="Good"
for i in range(3):
    if list[count]==list[count+1]:
        str="Bad"
    count=count+1
print(str)
import sys
sys.setrecursionlimit(10**15)

def f(a,b):
    if a==b:return a
    if not a<b:a,b=b,a
    return f(a,b-a)+2*a

N,X=map(int,input().split())
print(f(X,N-X)+N)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def f(a,b):
    if a==b:return a
    if not a<b:a,b=b,a
    return 2*(b//a)*a+f(a,b%a) if b%a else 2*(b//a)*a-a

N,X=map(int,input().split())
print(f(X,N-X)+N)
a = []
while True:
    n = input()
    if n == -1:
        break
for i in range(len(a)):
    if(a[i]==0):
        break
    else:
        print(a[i])

### FIXED CODE ###

i=1
while(1):
    n=input()
    if(int(n)==0):
        break
    else:
        print('Case '+str(i)+': '+n)
        i+=1
a, b = [int(i) for i in input().split()])
print(a-b)


### FIXED CODE ###

a, b = [int(i) for i in input().split()]
print(a-b)
n = int(input())
a = [int(i) for i in input().split()]

a1 = a[::2]
a2 = a[1::2]

from collections import defaultdict

d1 = defaultdict(int)
for ai in a1:
	d1[ai] += 1  

d2 = defaultdict(int)
for ai in a2:
	d[ai] += 1  

an1 = list(d1.items())
an1.sort(key = lambda x: -x[1])

an2 = list(d2.items())
an2.sort(key = lambda x: -x[1])

if an1[0][0] == an2[0][0]:
	print(n - max(an1[0][1] + an2[1][1], an1[1][1] + an2[0][1]))
else:
	print(n - an1[0][1] - an2[0][1])


### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]

a1 = a[::2]
a2 = a[1::2]

from collections import defaultdict

d1 = defaultdict(int)
d1[0] = 0
for ai in a1:
	d1[ai] += 1  

d2 = defaultdict(int)
d2[0] = 0
for ai in a2:
	d2[ai] += 1  

an1 = list(d1.items())
an1.sort(key = lambda x: -x[1])

an2 = list(d2.items())
an2.sort(key = lambda x: -x[1])

if an1[0][0] == an2[0][0]:
	print(n - max(an1[0][1] + an2[1][1], an1[1][1] + an2[0][1]))
else:
	print(n - an1[0][1] - an2[0][1])
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def myinput():
    return map(int,readline().split())

n = int(readline())
a = list(myinput())
mod = 10**9 + 7
ans = 0

import math
m = math.floor(math.log(max(a),2))+1

if max(a)==0:
  print(0)
  exit()

for j in range(m):
    one = 0
    zero = 0
    for i in range(n):
        b = str(bin(a[i]))[2:]
        c = b.zfill(m)
        s = int(c[m-j-1])
        if s==0:
            zero += 1
        else:
            one += 1
    ans_bit = zero * one
    ans += (ans_bit)*(2**j) 
    ans %= mod
print(ans%mod)

### FIXED CODE ###

import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def myinput():
    return map(int,readline().split())

n = int(readline())
a = list(myinput())
mod = 10**9 + 7
ans = 0

for j in range(60):
    k = 2**j
    one = 0
    zero = 0
    for i in range(n):
        if (a[i]&k):
            one += 1
        else:
            zero += 1
    ans_bit = zero * one
    ans += (ans_bit)*(2**j) 
    ans %= mod   

print(ans%mod)
import numpy as np
N,T=map(int,input().split())
D=[ [x,y,z,x+y+z,10000*x+5000*y+1000*z] for x in range(N+1) for y in range(N+1)for z in range(N+1)]
D=np.array(D)
index = np.where(D[:, -1] == T)
DD=D[index]
ans = np.where(DD[:, -2] == N)
if len(DD[ans])==0:
  print("-1 -1 -1")
else:
  print(str(DD[ans][0][0])+" "+str(DD[ans][0][1])+" "+str(DD[ans][0][2]))

### FIXED CODE ###

N,Y=map(int,input().split())

L=[[h,i,N-h-i]for h in range(N+1) for i in range(N+1) if h*1000+i*5000+(N-h-i)*10000==Y and (N-h-i)>=0]

if len(L)>0:
  print(L[0][2],end=" ")
  print(L[0][1],end=" ")  
  print(L[0][0])
else:
  print("-1 -1 -1")
n=int(input())

div1 = 1
div2 = n
result = 10*10
for i in range(1,int(n**0.5+1)):
  if n % i == 0:
    div1 *= i
    div2 /= i
    div_sum = div1 + div2
    result = min(result, div_sum)
print(int(div_sum-2))

### FIXED CODE ###

n=int(input())

div = n
result = 10**12

for i in range(1,1000001):
  if n % i == 0:
    div = n // i
    result = min(result, i+div)

print(int(result-2))