Harryxun/stf_run huggingface dataset:
import fractions

input()
A=set([int(i) for i in input().split()])

ans=1
for a in A:
    A2=A-{a}
    ans=max(ans,fractions.gcd(*A2))

print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

import fractions
from functools import reduce

N=int(input())
A=[int(i) for i in input().split()]

def mygcd(a,b):
    if a==0:
        return b
    elif b==0:
        return a
    else:
        return fractions.gcd(a,b)

L=[0]*N
for i in range(1,N):
    L[i]=mygcd(L[i-1],A[i-1])

R=[0]*N
for i in range(N-2,-1,-1):
    R[i]=mygcd(R[i+1],A[i+1])

ans=1
for i in range(N):
    c=mygcd(L[i],R[i])
    ans=max(ans,c)

print(ans)
from math import gcd
def lcm(a,b):
    return a*b//gcd(a,b)
mod=10**9+7
N = int(input())
A = list(map(int,input().split()))

def pow_mod(x,n):
    if n==0:
        return 1
    
    K = 1
    while n>1:
        if n%2 != 0:
            K *= x
            K %= mod
        x *= x
        x %= mod
        n //= 2

    return K*x

Gcd = lcm(A[0],A[1])
ans = Gcd//A[0]+Gcd//A[1]
temp = Gcd//A[1]
#print(temp)

for i in range(1,N-1):
    Gcd = lcm(A[i],A[i+1])
    temp2 = Gcd//A[i]
    Gcd2 = lcm(temp,temp2)
    #print(Gcd)
    #print(temp)
    #print(temp2)
    #print(Gcd2)
    a = Gcd2//temp
    b = Gcd2//temp2

    temp = Gcd//A[i+1]*b

    a %= mod
    b %= mod
    ans *= a
    ans %= mod
    ans += Gcd//A[i+1]*b
    ans %= mod


print(ans)



### FIXED CODE ###

from fractions import gcd
import sys 
input = sys.stdin.readline

def pow_mod(x,n):
    if n==0:
        return 1
    
    K = 1
    while n>1:
        if n%2 != 0:
            K *= x
            K %= mod
        x *= x
        x %= mod
        n //= 2

    return K*x

mod=10**9+7
N = int(input())
A = list(map(int,input().split()))

if N==1:
    print(1)
    exit()

Gcd = gcd(A[0],A[1])
ans = (A[0]//Gcd+A[1]//Gcd)%mod
temp = A[0]//Gcd

for i in range(1,N-1):
    #Gcd = lcm(A[i],A[i+1])
    Gcd = gcd(A[i],A[i+1])
    #temp2 = Gcd//A[i]
    temp2 = A[i+1]//Gcd
    #Gcd2 = lcm(temp,temp2)
    Gcd2 = gcd(temp,temp2)

    #a = Gcd2//temp
    a = temp2//Gcd2
    #b = Gcd2//temp2
    b = temp//Gcd2

    temp = A[i]//Gcd*b

    a %= mod
    b %= mod
    ans *= a
    ans %= mod


    Gcd %= mod #注意
    c = A[i]
    c %= mod
    d = c*pow_mod(Gcd,mod-2)
    #d = Gcd//c
    d %= mod


    e = b*d%mod
    ans += e
    #ans += Gcd//A[i+1]*b
    ans %= mod


print(ans)
import itertools
import collections
from operator import mul
from functools import reduce

N,A,B = map(int,input().split())
V = sorted(list(map(int,input().split())),reverse = True)
a = A - 1
top = V[0]
ans = 0

if top == V[a]:
  d = 1
  for i in range(1,B + 1):
    if V[i] != top:
      B = i
      break
  for i in range(1,B + 1):
    n = 1
    d *= i
    
    if i < A:
      continue
    for j in range(B,B - i,-1):
      n *= j
    n /= d
    ans += n
  print(float(top))
  print(int(ans))
else:
  sect = V[:A]
  ave = sum(sect) / A
  print(ave)
  con = V.count(V[a])
  ind = V.index(V[a])
  i = a - ind + 1
  if a == ind:
    print(con)
  else:
    n = reduce(mul,[t for t in range(con - i + 1,con + 1)]) 
    d = reduce(mul,[k for k in range(1,i + 1)])
    print(int(n/d))



### FIXED CODE ###

import collections
from operator import mul
from functools import reduce

N,A,B = map(int, input().split())
V = list(map(int, input().split()))
VV = sorted(V,reverse = True)
ave = 0
ml = []

for i in range(A,B + 1):
  avet = sum(VV[:i]) / i
  if avet >= ave:
    ml.append(i)
    ave = max(ave,avet)
  else:
    break

dic = collections.Counter(V)
#print(dic,ml)

def cmb(n,r):
  r = min(n - r,r)
  if r == 0:
    return 1
  over = reduce(mul,range(n, n - r, -1))
  under = reduce(mul,range(1,r + 1))
  return over // under

res = 0

for j in ml:
  r = dic[VV[j - 1]]
  rr = VV.index(VV[j - 1])
  res += cmb(r,j - rr)

print(ave)
print(res)
# coding:utf-8

x=map(int,(raw_input().split()))

if int(x[0]) < x[1]) < x[2]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

# coding:utf-8

x=map(int,(raw_input().split()))

if x[0] < x[1] < x[2]:
    print("Yes")
else:
    print("No")
n=int(input())
p=[]
for_ in range(n):
	x=int(input())
	p.append(x)
ans=sum(p)-(max(p) // 2)
print(ans)

### FIXED CODE ###

n=int(input())
p=[]
for _ in range(n):
	x=int(input())
	p.append(x)
ans=sum(p)-(max(p) // 2)
print(ans)
N, Y = map(int, input().split())
total = 0
for x in range(N + 1):
    for y in range(N + 1 - x):
        for z in range(N + 1 - x - y):
            if Y == 10000 * x + 5000 * y + 1000 * z:
                total = total + 1
                ans = str(x) + " " + str(y) + " " + str(z)
                print(ans)
                break
        else:
            continue
        break
    else:
        continue
    break
break
if total ==0:
    print("-1 -1 -1")

### FIXED CODE ###

N, Y = map(int, input().split())
for x in range(N + 1):
    for y in range(N - x + 1):
        z = N - x - y
        if Y == 10000 * x + 5000 * y + 1000 * z:
            print(x, y, z)
            exit()
print(-1, -1, -1)
import math

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      ans += gcd(a, b, c)

print(ans)

### FIXED CODE ###

import math

def gcd(*numbers):
    return reduce(math.gcd, numbers)

K = int(input())

ans = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      ans += math.gcd(math.gcd(a, b), c)

print(ans)
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

def knapsack(sm,W,n,V):
    K = [[0]*(sm+1) for i in range(n+1)]
    for i in range(1,n+1):
        for j in range(1,sm+1):
            K[i][j] = K[i-1][j]
            if W[i-1] <= j:
                K[i][j] = max(V[i-1]+K[i-1][j-W[i-1]], K[i-1][j])
    return K[n][sm]

n,wt = ip()
V,W = [0]*n,[0]*n
for i in range(n):
    w,v = ip()
    V[i] = v
    W[i] = w

ans = knapsack(wt,W,n,V)
print(ans)
    


### FIXED CODE ###

#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

def knapsack(wt,sm,W,n,V):
    K = [float('inf')]*(sm+1)
    K[0] = 0
    for i in range(n):
        for j in range(sm-V[i],-1,-1):
                K[j+V[i]] = min(K[j+V[i]],K[j]+W[i])
    #print(K)
    return max([i for i in range(sm+1) if K[i] <= wt])

n,wt = ip()
V,W = [0]*n,[0]*n
for i in range(n):
    w,v = ip()
    V[i] = v
    W[i] = w
ans = knapsack(wt,sum(V),W,n,V)
print(ans)
A = [map(int,input().split()) for i in range(1)]

A.sort()

print(A[0]+A[1])





### FIXED CODE ###

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

A.sort()

print(A[0]+A[1])
n=int(input())
a=list(map(int,input().split()))
m=int(input())
b=[map(int,input().split()) for _ in range(m)]
for i in b:
    print(sum(a)-a[i[0]]+i[1])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
m=int(input())
for i in range(m):
    s,t=map(int,input().split())
    print(sum(a)-a[s-1]+t)
t=input()

new=""
ans=0
ans_new=""
count=0

def func(new,t,i=0):
    global ans,ans_new
    if i==len(t):
        #print(new)
        if ans < new.count("D")+new.count("PD"):
            ans=new.count("D")+new.count("PD")
            ans_new=new
            #print(ans_new)

        return

    if t[i]=="?":
        return func(new+"P",t,i+1) or func(new+"D",t,i+1)
    else:
        return func(new+t[i],t,i+1)

i=0
func(new,t,i)
print(ans_new)


### FIXED CODE ###

t=input()

new=""
for i in range(len(t)):
    if t[i] != "?":
        new+=t[i]
    else:
        if new=="":
            new+=t[i]
        elif new[-1]=="P":
            new+="D"
        else:
            new+=t[i]

t=new
new=""

for i in reversed(range(len(t))):
    if t[i] != "?":
        new=t[i]+new
    else:
        if new=="":
            new=t[i]+new
        elif new[0]=="D":
            new="P"+new
        else:
            new=t[i]+new

t=new
new=""

for i in range(len(t)):
    if t[i] != "?":
        new+=t[i]
    else:
        new+="D"


print(new)
from collections import defaultdict
from operator import mul
from functools import reduce
MOD = 10**9+7
N, K = map(int, input().split())
es = defaultdict(list)
log = [1]*N

for i in range(N-1):
  a, b = map(int, input().split())
  es[a-1] += [b-1]
  es[b-1] += [a-1]
  
if K==1:
  print(0)
  
else:
  stuck = []
  log[a-1] = 0
  ans = K
  n = 0
  for c in es[a-1]:
    log[c] = 0
    n += 1
    stuck += [c]
  if K-1<n:
    print(0)
  else:
    ans *= reduce(mul, range(K-1, K-1-n, -1))
    while stuck:
      e = stuck.pop()
      n = 0
      for c in es[e]:
        if log[c]:
          stuck += [c]
          n += 1
          log[c] = 0
      if K-2<n:
        ans *= 0
        break
      elif n==0:
        continue
      else:
        ans *= reduce(mul, range(K-2, K-2-n, -1))
      ans %= MOD
    print(ans)

### FIXED CODE ###

from collections import defaultdict, deque
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    return g1[n] * g2[r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N, K = map(int, input().split())
dic = defaultdict(list)
for i in range(N-1):
  a, b = map(int, input().split())
  dic[a-1] += [b-1]
  dic[b-1] += [a-1]

log = [float('inf')]*N
log[0] = 0
q = deque([0])
ans = K
while q:
  p = q.popleft()
  if log[p]<1:
    ans *= cmb(K-1,K-1-len(dic[p]),mod)
  else:
    ans *= cmb(K-2,K-1-len(dic[p]),mod)
  ans %= mod
  for e in dic[p]:
    if log[e]>log[p]+1:
      q += [e]
      log[e] = log[p]+1
print(ans)
def tri(a,b,c):
	return a^2 == b^2 + c^2
for time in range(int(input())):
	x,y,z = [int(i) for i in input().split()]
	if tri(x,y,z) or tri(y,z,x) or tri(z,x,y):
		print(???YES???)
	else:
		print(???NO???)

### FIXED CODE ###

def tri(a,b,c):
	return a**2 == b**2 + c**2
for time in range(int(input())):
	x,y,z = [int(i) for i in input().split()]
	if tri(x,y,z) or tri(y,z,x) or tri(z,x,y):
		print("YES")
	else:
		print("NO")
N,K = map(int, input().split())
i = 1
while K**i =< N:
    i+=1
else:
    print(i)

### FIXED CODE ###

N,K = map(int, input().split())
i = 1
while K**i <= N:
    i+=1
else:
    print(i)
n=int(input())
t,a=map(int,input().split())
h=[]
for i in rrange(n):
    tmp=int(input)
    c=t-tmp*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m)


### FIXED CODE ###

n=int(input())
t,a=map(int,input().split())
h=[]
tmp=input()
lst=tmp.split(' ')

for i in range(n):
    c=t-int(lst[i])*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m+1)
n = int(input())
a = 0
while True:
  while n > 0:
    a = a + (n % 10)
    n = int(n / 10)
  if a < 10:
      break
  n = a
  a = 0
if a == 9:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

n = str(input())
a = int(0)
for i in range(len(n)):
    a = a + int(n[i])
if a % 9 == 0:
    print("Yes")
else:
    print("No")
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

# fact(int)
def fact(n):
  if(n == 1):
    return 1
  else:
    return (n * fact(n - 1))

# gcd(int,int)
def gcd(a,b):
  if a == 0:
    return b
  elif b == 0:
    return a
  else:
    return gcd(b,a % b)

# lcm(int,int)
def lcm(a,b):
  return (a * b / gcd(a,b))

# qsort(array[])
def qsort(seq):
  if len(seq) < 1:
      return seq
  pivot = seq[0]
  left = []
  right = []
  for x in range(1, len(seq)):
    if seq[x] <= pivot:
        left.append(seq[x])
    else:
        right.append(seq[x])
  left = qsort(left)
  right = qsort(right)
  foo = [pivot]
  return (left + foo + right)

#  = map(int, input().split())
#  = int(input())
#  = raw_input().split()
#  = list(int(i) for i in input().split())  

n = int(input())
a = int(input())
if n % 500 <= a:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/

import math
import statistics

n = int(input())
a = int(input())
if n % 500 <= a:
  print('Yes')
else:
  print('No')
s=list(input())
a=s[0]+ s[1]+ s[2]+ s[3]
if a=='YAKI':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s=input()
if len(s)<4:
    a=1
else:
    a=s[0]+ s[1]+ s[2]+ s[3]
if a=='YAKI':
    print('Yes')
else:
    print('No')
n=int(nput())
if n%9==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N=input()
l = [int(x) for x in list(N)]
s=sum(l)
if s%9==0:
  print("Yes")
else:
  print("No")
a = input()
b = input()

N = int(a)
S = b

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)

### FIXED CODE ###

string = input()
#days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

if string =="SUN":
  print(str(7))
elif string == "MON":
  print(str(6))
elif string == "TUE":
  print(str(5))
elif string == "WED":
  print(str(4))
elif string == "THU":
  print(str(3))
elif string == "FRI":
  print(str(2))
elif string == "SAT":
  print(str(1))
import sys

def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    h = list(map(int, input().split()))

    dflag = 0
    cmin = 0
    cmax = h[0]
    count = 0
    for i in range(1, N):
        if h[i - 1] < h[i] and dflag == 1:
            count += cmax-cmin
            cmax=h[i]
            dflag=0
            cmin=h[i-1]

        elif h[i-1]>h[i]:
            dflag=1

        elif h[i-1]<h[i]:
            cmax=h[i]

    if dflag==1:
        count+=cmax-cmin
    else:
        count+= max(cmax,h[i])-cmin

    print(count)



if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    if N==1:
        print(input())
        exit()
    h = list(map(int, input().split()))


    dflag = 0
    cmin = 0
    cmax = h[0]
    count = 0
    for i in range(1, N):
        if h[i - 1] < h[i] and dflag == 1:
            count += cmax - cmin
            cmax = h[i]
            dflag = 0
            cmin = h[i - 1]

        elif h[i - 1] > h[i]:
            dflag = 1

        elif h[i - 1] < h[i]:
            cmax = h[i]

    if dflag == 1:
        count += cmax - cmin
    else:
        count += max(cmax, h[i]) - cmin

    print(count)


if __name__ == "__main__":
    main()
n,k = map(int, input().split())
if n==1:
  print(abs(int(input())))
  exit()
a = list(map(int, input().split()))
g = []
for i in range(n-k):
  b = a[i]
  c = a[i+k-1]
  if c<=0:
    g.append(-b)
  elif b>=0:
    g.append(c)
  else:
    g.append(c-b+min(abs(b),abs(c)))
print(min(g))

### FIXED CODE ###

n,k = map(int, input().split())
if n==1:
  print(abs(int(input())))
  exit()
a = list(map(int, input().split()))
g = []
for i in range(n-k+1):
  b = a[i]
  c = a[i+k-1]
  if c<=0:
    g.append(-b)
  elif b>=0:
    g.append(c)
  else:
    g.append(c-b+min(abs(b),abs(c)))
print(min(g))
N = int(input())
hina = []
for N in range(0,N):
    S = input()
    hina.append(S)

if "Y" in hina:
    print("Four")
else:
    print("Three")

### FIXED CODE ###

N = int(input())

hina = [S for S in input().split()]

if "Y" in hina:
    print("Four")
else:
    print("Three")
N, Y = list(map(int, input().split()))
final_ans = None
for i in range(N + 1):
    for j in range(N + 1):
        # print(i, j, N - i - j)
        ans = i * 10000 + j * 5000 + (N - i - j) * 1000
        if ans == Y:
            final_ans = f"{i} {j} {N - i - j}"
            break

if final_ans is None:
    print('-1 -1 -1')
else:
    print(final_ans)

### FIXED CODE ###

N, Y = list(map(int, input().split()))
final_ans = None
for i in range(N + 1):
    for j in range(N + 1):
        if i + j > N:
            continue
        ans = i * 10000 + j * 5000 + (N - i - j) * 1000
        if ans == Y:
            final_ans = " ".join([str(i), str(j), str(N - i - j)])
            break

if final_ans is None:
    print('-1 -1 -1')
else:
    print(final_ans)
a,b=map(int, input().split())

if a>b:
	print(‘a>b’)
elif a<b:
	print(‘a<b’)
else:
	print(‘a==b’)


### FIXED CODE ###

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

if a>b:
	print("a > b")
elif a<b:
	print("a < b")
else:
	print("a == b")
import math

l = [input() for x in range(4)]
dist = math.sqrt(math.fabs(l[0] - l[2])**2 + math.fabs(l[1] - l[3])**2)
print dist

### FIXED CODE ###

import math

l = map(float, raw_input().split())
dist = math.sqrt((l[0] - l[2])**2 + (l[1] - l[3])**2)
print dist
def main():
    n = int(input())
    As = list(map(int, input().split()))
    nums = []
    rainbow = 0
    for A in As:
        num = A // 400
        if num < 8:
            if num not in nums:
                nums.append(num)
        else:
            rainbow += 1
    ans_max = len(nums)+rainbow
    ans_min = max(len(1, nums))
    print(ans_min, ans_max)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    As = list(map(int, input().split()))
    nums = []
    rainbow = 0
    for A in As:
        num = A // 400
        if num < 8:
            if num not in nums:
                nums.append(num)
        else:
            rainbow += 1
    ans_max = len(nums)+rainbow
    ans_min = max(1, len(nums))
    print(ans_min, ans_max)


if __name__ == "__main__":
    main()
a = int(input())
b = int(input())
c = int(b - a)
d = c * (c -1) / 2
e = int(c -1)
f = int(1 + d + e)
print(int(f - b))



### FIXED CODE ###

a, b = map(int, input().split())
c = int(b - a)
d =int( c * (c - 1) // 2 + c  -b)
print(d)
s = input()
K = int(input())
w = []
for i in range(len(s)-K+1):
  for j in range(i,i+K):
    temp = s[i:j+1]
    if temp not in w:
      w.append(temp)
      
w.sort()
print(w[K-1])

### FIXED CODE ###

s = input()
K = int(input())
w = []
for i in range(len(s)):
  for j in range(i,i+K):
    temp = s[i:j+1]
    if temp not in w:
      w.append(temp)
      
w.sort()
print(w[K-1])
import numpy as np
 
N = int(input())
A= list(map(int, input().split()))
A=np.array(A)
S=np.array(range(N))
 
con=np.vstack([A,S])
 
con=con[:, con[0,:].argsort()]
ans=con[1,]+1
ans=str(ans)
print(ans)


### FIXED CODE ###

A = int(input())
mod = A%2


if mod==0:
  print("0.5")
else:
  print((A+1)/(A*2))
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes")


### FIXED CODE ###

N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
l.sort(key= lambda x:x[1])
t=0
cnt=0
for i in l:
    cnt+=1
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    elif cnt==N:
        print("Yes");
L,R = map(int, input().split())

if R - L >= 2019:
    print(0)
else:
    m = 2020
    for i in range(L, R):
        m = min(m, i % 2019)
    print(m * (m+1))


### FIXED CODE ###

N,A,B = map(int, input().split())
print(N*A if N*A <= B else B)
age,cost= list(map(int, input().split()))
if 0<age<100 and 2<cost<1000:
	if age<=5:
      print('0')
	elif age>=6 and age<=12:
      print(a/2)
	else:
  	  print(a)


### FIXED CODE ###

n,k=tuple(map(int,input().split()))
if n >= 13:
  print(k)
elif 6 <= n <= 12:
  print(k//2)
elif n <= 5:
  print(0)
Npt

### FIXED CODE ###

n=int(input())
a = input()
b = input()
c = input()
ans=0
for i in range(n):
    l=[a[i],b[i],c[i]]
    ans+=len(set(l))-1
print(ans)
noded = {}
edad = {}

class Node:
    def __init__(self, index):
        self.index = index
        self.color = -1
        self.eda_list = []

class Eda:
    def __init__(self, index, w, left, right):
        self.index = index
        self.w = w
        self.left = left
        self.right = right

def color_oppo_of(node):
    c = node.color
    for eda in [edad[edai] for edai in node.eda_list]:
        if eda.right == node.index:
            oppo = eda.left
        else:
            oppo = eda.right

        if noded[oppo].color == -1:
            if eda.w % 2 == 0:
                noded[oppo].color = node.color
            else:
                noded[oppo].color = (node.color + 1) % 2
            color_oppo_of(noded[oppo])

def solve():
    n = int(input())
    for i in range(n-1):
        U, V, W = map(int, input().split())
        u = U
        v = V
        w = W

        eda = Eda(i, w, u, v)
        edad[i] = eda

        if u not in noded.keys():
            noded[u] = Node(u)
        noded[u].eda_list.append(i)

        if v not in noded.keys():
            noded[v] = Node(v)
        noded[v].eda_list.append(i)

    noded[1].color = 0
    color_oppo_of(noded[1])

    for i in range(1, n+1):
        print(noded[i].color)
        #print(vars(noded[i]))



solve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

noded = {}
edad = {}

class Node:
    def __init__(self, index):
        self.index = index
        self.color = -1
        self.eda_list = []

class Eda:
    def __init__(self, index, w, left, right):
        self.index = index
        self.w = w
        self.left = left
        self.right = right

def color_oppo_of(node):
    c = node.color
    for eda in [edad[edai] for edai in node.eda_list]:
        if eda.right == node.index:
            oppo = eda.left
        else:
            oppo = eda.right

        if noded[oppo].color == -1:
            if eda.w % 2 == 0:
                noded[oppo].color = node.color
            else:
                noded[oppo].color = (node.color + 1) % 2
            color_oppo_of(noded[oppo])

def solve():
    n = int(input())
    if n == 1:
        print("0")
    else:
        do(n)


def do(n):
    for i in range(n-1):
        U, V, W = map(int, input().split())
        u = U
        v = V
        w = W

        eda = Eda(i, w, u, v)
        edad[i] = eda

        if u not in noded.keys():
            noded[u] = Node(u)
        noded[u].eda_list.append(i)

        if v not in noded.keys():
            noded[v] = Node(v)
        noded[v].eda_list.append(i)

    noded[1].color = 0
    color_oppo_of(noded[1])

    for i in range(1, n+1):
        print(noded[i].color)
        #print(vars(noded[i]))



solve()
import sys

N = int(sys.stdin.readline())

i = 0
count = 0

while i ** 2 <= N:
  if N // i == N % i:
    count += 1

print(count)

### FIXED CODE ###

import sys

N = int(sys.stdin.readline())
i = 1
s = 0

while i ** 2 <= N:
    if N % i == 0:
        k = N // i - 1
        if k > i:
            s += k
    i += 1
print(s)