peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())

    neg = sum(1 for a in A if a < 0)
    ans = sum(abs(a) for a in A)

    if neg % 2 == 1:
        ans -= 2 * min(abs(a) for a in A)

    print(ans)
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
w,h,n=map(int,input().split())
b=[0,w,0,h]
for i in range(n):
    x,y,a=map(int,input().split())
    if a==1:
        b[0]=max(b[0],x)
    elif a==2:
        b[1]=min(b[1],x)
    elif a==3:
        b[2]=max(b[2],y)
    else:
        b[3]=min(b[3],y)
print(max(b[1]-b[0],0)*max(b[3]-b[2],0))
# Judge status: Accepted
x = list(map(int, input().split()))

for i in range(0, len(x)):
    if x[i]==0:
        print(i+1)
# Judge status: Accepted
# -*- coding: utf-8 -*-
ab, bc, ca = map(int,input().split()) 

ans = ab * bc * ca // max(ab, bc, ca)
print(ans // 2)
# Judge status: Accepted
# coding: utf-8
S = input()
alp = "abcdefghijklmnopqrstuvwxyz"
for a in alp:
    if a not in S:
        print(a)
        exit()
print("None")
# Judge status: Wrong Answer
w,a,b=map(int,input().split())
print(min(abs(b-a-w),abs(a-b),abs(b+w-a)))
# Judge status: Accepted
s = input()
l = []

prev = ""
pres = ""
cnt = 0

for i in s:
  pres += i
  #print(pres,prev)
  if pres!=prev:
    cnt += 1
    prev = pres
    pres = ""
print(cnt)
# Judge status: Accepted
a = input()
print("Yes" if "9" in a else "No")
# Judge status: Accepted
x, y = map(int, input().split())

i = x
ans = 1
while i*2 <= y:
    i *= 2
    ans += 1

print(ans)
# Judge status: Wrong Answer
H1, M1, H2, M2, K = map(int, input().split())

H = (H2 - H1) * 60
M = M2 - M1

res = (H+M) - 30

if res > K:
    print((H+M) - 30)
else:
    print(0)
# Judge status: Accepted
A, B = map(int, input().split())

if B == 1:
    print(0)
    exit()

else:
    for i in range(20):
       if B <= A+i*(A-1):
           print(1+i)
           exit()
# Judge status: Accepted
a,b,c = map(int, input().split())
ans = "NO"
if a+b+c == 17 and a*b*c == 175:
  ans = "YES"
print(ans)
# Judge status: Wrong Answer
def main():
    a, b, c = map(int, input().split())
    list = []
    list.append(a)
    list.append(b)
    list.append(c)

    if list.count(5) == 2 and list.count(7) == 1 :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input(); n = len(s); INF=1<<32
dp = [ [0,INF] for i in range(n+1) ]
for i in range(n):
  d = int(s[i])
  dp[i+1][0] = min(dp[i][0], dp[i][1])+d
  dp[i+1][1] = min(dp[i][0], dp[i][1]-2)+11-d
print(min(dp[n][0],dp[n][1]))
# Judge status: Wrong Answer
data = input().split()

n = int(data[0])
m = int(data[1])

pro = [int(s) for s in input().split()]

vote = 0
for i in pro:
  vote += i

if pro[m - 1] < 1 / (4 * vote):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
A,B,C= map(int,input().split())
for i in range(B) :
    if A*i%B == C :
        print('YES')
        exit()
print('NO')
# Judge status: Wrong Answer
lst = []
s = sorted(list(input()))
lst.append(s)
t = sorted(list(input()),reverse=True)
lst.append(t)
lst.sort()
if lst[0] == s:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
nums = list(map(str, input().split()))
s = "".join(nums)
n = int(s)
if n % 4 == 0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = [0 for _ in range(N)]
l = 0
r = N - 1
flg = 1
for i in range(N - 1, -1, -1):
    if flg:
        flg = 0
        ans[l] = A[i]
        l += 1
    else:
        flg = 1
        ans[r] = A[i]
        r -= 1
print(*ans)
# Judge status: Accepted
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, D = list(map(int, sys.stdin.readline().split()))
    look = 2 * D + 1
    print(math.ceil(N / look))


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,m=map(int,input().split())
    A=[int(_) for _ in input().split()]
    B=[int(_) for _ in input().split()]
    ans=min(A)+min(B)
    for i in range(m):
        x,y,c=map(int,input().split())
        ans=min(ans,A[x-1]+B[y-1]-c)
    print(ans)

if __name__=='__main__':
    main()
# Judge status: Accepted
W, a, b = map(int, input().split())
if a > b:
  k = b
  b = a
  a = k
if a + W >= b:
  print(0)
else:
  print(b - (a + W))
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n):
    b[a[i]-1] += 1
c = [i for i in b if i != 0]
c.sort()
if len(c) - k > 0:
    print(sum((c[0:len(c)-k])))
else:
    print(0)
# Judge status: Accepted
import math

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

ans = 0
for n in range(1, N+1):
    if n >= K:
        ans += 1/N
        continue
    x = math.ceil(math.log2(K/n))
    ans += (0.5**x)/N

print(ans)
# Judge status: Wrong Answer
from itertools import accumulate
import bisect
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a=list(accumulate(A))
b=list(accumulate(B))
diff=2*10**9
count=0
for i in range(N):
    j=bisect.bisect_right(b,K-a[i])-1
    if 0<=K-(a[i]+b[j])<=diff:
        diff=K-(a[i]+b[j])
        count=max(count,(i+1)+(j+1))
print(count)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

#n=10
#a=[3, 1, 4, 1, 5, 9, 2, 6, 5, 3]
#a=[3, 14, 159, 2653, 58979, 323846, 2643383, 27950288, 419716939, 9375105820]

mod=10**9+7
asum=0
for i in range(60):
    zcnt=0
    for ii in range(n):
        asht=a[ii]>>i
        if asht&1==0:
            zcnt+=1
    tmp=(zcnt*(n-zcnt))%mod*((2**i)%mod)
    asum+=(tmp)%mod
               
asum=asum%mod
print(asum)
# Judge status: Accepted
a, b = map(int, input(). split())
ans = -1
for i in range(10001):
  if i*8//100 == a and i//10 == b:
    ans = i
    break
  else:
    ans = -1
print(ans)
# Judge status: Wrong Answer
H1, M1, H2, M2, K = list(map(int, input().split()))
time = H2*60+M1-H2*60-M2
print(time-K)
# Judge status: Accepted
s = input()
n = len(s)

diff0 = 0
diff1 = 0

for i in range(n):
    m = int(s[i])
    if i % 2 != m:
        diff0 += 1
    else:
        diff1 += 1
print(min(diff0, diff1))
# Judge status: Accepted
"""
author : halo2halo
date : 9, Jan, 2020
"""

import sys

# import numpy as np
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

P = [int(i) for i in read().split()]
ans=sum(P)
for i in itertools.combinations(P,len(P)-1):
    ans=min(ans,sum(i))

print(ans)
# Judge status: Accepted
N,W = map(int,input().split())
dp = [[0 for i in range(W+1)] for j in range(N+1)]

for i in range(1,(N+1)):
    w, v = map(int, input().split())
    for j in range(1,W+1):

        if j-w<0:
            dp[i][j] = max(dp[i-1][j],dp[i][j-1])
        else:
            dp[i][j] = max(dp[i-1][j-w]+v,dp[i-1][j])

print(max(max(dp)))
# Judge status: Accepted
N = int(input()[-1])
if N in [2,4,5,7,9]:
    print("hon")
elif N in [0,1,6,8]:
    print("pon")
elif N == 3:
    print("bon")
# Judge status: Accepted
def main():
    import sys
    import bisect

    read = sys.stdin.buffer.read
    bisect_right = bisect.bisect_right

    N, *A = map(int, read().split())

    dp = [A[-1]]
    for a in reversed(A[:-1]):
        if a >= dp[-1]:
            dp.append(a)
        else:
            dp[bisect_right(dp, a)] = a

    print(len(dp))
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = list(map(str,input()))
k = int(input())
ans = [0]*len(s)



b = 123
for i in range(len(ans)):
    tmp = ord(s[i])
    if i != len(ans)-1:
        if b - tmp <= k:
            k = k-(b - tmp)
            ans[i] = "a"
        else:
            ans[i] = s[i]
    
    else:
        tmp1 = k % 26
        ans[i] = 96+tmp1
        ans[i] = chr(ans[i])            
       
print("".join(ans))
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
l.sort()
from bisect import bisect_left
ans=0
for i in range(n):
    for j in range(i+1,n):
        a=l[i]
        b=l[j]
        ans+=max(0,bisect_left(l,a+b)-j-1)
print(ans)
# Judge status: Accepted
x = int(input())
maxx = 1
for i in range(1, x):
  for j in range(2, x):
    expx = i ** j
    if expx <= x:
      if maxx <= expx:
        maxx = expx
    else:
      break
print(maxx)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
print(a*b/2)
# Judge status: Accepted
#!/usr/bin/env python3
import sys


def solve(X: int):
    f=(X//500)*1000
    ft=((X%500)//5)*5
    print(f+ft)
    return


# Generated by 1.1.6 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()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N = int(input())
ans = list()

for i in range(N+1):
    ans.append(0)

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            tmp = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if tmp < N:
                ans[tmp] += 1
for i in range(N):
    print(ans[i+1])
# Judge status: Wrong Answer
N,M = map(int,input().split())
if M==1: print(1);exit()
ans = 1
for i in range(2,min(int(M**(1/2))+2,int(M/N)+1)):
    if M%i==0: ans = i
print(ans)
# Judge status: Accepted
from itertools import accumulate
N, K = map(int, input().split())
A = list(map(int, input().split()))

i = 0
for _ in range(min(K, 50)):
    B = [0] * (N + 1)
    for i, a in enumerate(A):
        j = max(0, i - a)
        B[j] += 1
        j = min(N, i + a + 1)
        B[j] -= 1
    B.pop()
    A = list(accumulate(B))

print(*A)
# Judge status: Wrong Answer
n,q=map(int,input().split())
s=input()
t=[1 if a=='A' and 'C' else 0 for a,c in zip(s,s[1:])] + [0]
for _ in range(q):
    l,r=map(int,input().split())
    print(sum(t[l-1:r-1]))
# Judge status: Accepted
x,y=map(int,input().split())

print(x+y//2)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
box = [0] * (N+1)
M = 0
ans = []

for i in range(N, 0, -1):
    tmp = 0
    for j in range(i*2, N+1, i):
        tmp += box[j]
    tmp = tmp % 2
    if tmp != A[i-1]:
        box[i] = 1
        M += 1
        ans.append(i)

if M == 0:
    print(0)
else:
    ans = ans[::-1]
    print(M)
    print(*ans)
# Judge status: Wrong Answer
N = int(input())
if N % 2 == 0:
    print((2/N)/N)
else:
    print((2//N)/(N+1))
# Judge status: Accepted
s = int(input())
mod = 10**9+7

dp = [0 for i in range(s+1)]

for i in range(3,s+1):
  for j in range(3,i-2):
    dp[i] += dp[j]
  dp[i] += 1
  dp[i] %= mod
print (dp[-1])
# Judge status: Accepted
def gcd(x, y):
    if x == 0:
        return y

    x, y = y % x, x
    return gcd(x, y)


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

ans = a * b // gcd(a, b)
print(ans)
# Judge status: Accepted
import math

dish=[int(input()) for _ in range(5)]
count={str(i%10):[] for i in range(10,-1,-1)}
for t in dish:
	one=t%10
	count[str(one)].append(t)

ans=0
d=0
for k,v in count.items():
	if v!=[]:
		for c in v:
			if d>3:
				ans+=c
			else:
				ans+=math.ceil(c/10)*10
				d+=1
print(int(ans))
# Judge status: Accepted
#!/usr/bin/env python3


def main():
    N = int(input())
    s = [input() for _ in range(N)]
    M = int(input())
    t = [input() for _ in range(M)]
    y = 0
    for ss in set(s):
        yy = s.count(ss) - t.count(ss)
        if y < yy:
            y = yy
    print(y)


main()
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

mn = min(l)
mx = max(l)

ms = 10**9
for j in range(mn, mx+1):
    s = sum([(i-j)**2 for i in l])
    ms = min(ms, s)
    
print(ms)
# Judge status: Wrong Answer
#A
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

ant = [a,b,c,d,e]
flg = True
for i in range(5):
    for j in range(i,5):
        if i != j:
            dist = abs(ant[i]-ant[j])
            if dist > k:
                flg = False
                break
if flg:
    print('Yey!')
else:
    print(':(')
# Judge status: Accepted
v = input().split(" ")
x = int(v[0])
k = int(v[1])
d = int(v[2])

if (x == 0):
    if (k % 2 == 0):
        ans = 0
    else:
        ans = d
else:
    if ((k * d) > abs(x)):
        y = abs(x) // d
        ans = abs(abs(x) - y * d)
        if ((k - y) % 2 == 1):
            ans = abs(d - ans)
    else:
        ans = abs(x) - k * d


print(ans)
# Judge status: Accepted
a,b,c = sorted(map(int,input().split()))
print(int(a*b/2))
# Judge status: Accepted
import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np

def main():
	s=input()
	t=input()

	ans=0

	for i in range(len(s)):
		if s[i]!=t[i]:
			ans+=1

	print(ans)





if __name__ == "__main__":
	main()
# Judge status: Accepted
h = int(input())
result, i = 0, 1
while h > 0:
    h //= 2
    result += i
    i *= 2
    
print(result)
# Judge status: Accepted
n = int(input())
a= [int(input()) for _ in range(n)]

count = 1
now = a[0]

while now != 2 and count < n:
  now = a[now-1]
  count += 1
print(count if count<n else -1)
# Judge status: Wrong Answer
N, K = map(int, input().split())
x = list(map(int, input().split()))
answer = float('inf')
for l, r in zip(x, x[K - 1:]):
    print(l, r)
    cost = r - l + min(abs(l), abs(r))
    answer = cost if cost < answer else answer

print(answer)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())

ans = 10 ** 18

for i in range(1, int(n ** (1 / 2)) + 2):
    if n % i != 0:
        continue
    j = n // i
    ans = min(ans, i + j - 2)

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
import math
print(math.ceil((a + b)/2))
# Judge status: Accepted
n = int(input())
res = 0

for i in range(1,n+1):
    cnt = 0
    for j in range(1,i+1):
        if i % 2 == 1 and i % j == 0:
            cnt += 1
    if cnt == 8: res += 1
print(res)
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
x = list(map(int,input().strip().split()))

rate = []
over = 0
for i in range(n):
  if x[i]//400 >=8:
    over += 1
  else:
    rate.append(x[i]//400)
result = ""
elem = len(set(rate))
if elem >= 8:
  result = "8 8"
elif elem + over >=8:
  result = str(elem) +" " +"8"
else:
  result = str(elem)+" "+ str(elem + over)
print(result)
# Judge status: Accepted
K = int(input())
A = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(0, K):
    if A[i]%10 != 0:
        A.append(10*A[i]+A[i]%10-1)
    A.append(10*A[i]+A[i]%10)
    if A[i]%10 != 9:
        A.append(10*A[i]+A[i]%10+1)
    if len(A) >= K:
        break
print(A[K-1])
# Judge status: Accepted
a, b, k = map(int, input().split())
prev = 0

for i in range(k):
    if a + i < b:
        print(a + i)
        prev = a + i

for i in range(k)[::-1]:
    if b - i > prev:
        print(b - i)
# Judge status: Accepted
p, q = divmod(int(input()), 11)
print(p*2 + (q and [1, 2][q > 6]))
# Judge status: Accepted
n,m=map(int,input().split())
a=list(map(int,input().split()))
t=sum(a)
if t>n:
  print(-1)
else:
  print(n-t)
# Judge status: Wrong Answer
s = list(map(int, input().split('/')))

if s[1] > 5:
    print('TBD')
else:
    print('Heisei')
# Judge status: Accepted
s="abcdefghijklmnopqrstuvwxyz"
import sys
sys.setrecursionlimit(10**6)
def dfs(a,n,m):
    if len(a)==n:
        print(a)
        return
    for i in range(m):
        if i==m-1:
            dfs(a+s[i],n,m+1)
        else:
            dfs(a+s[i],n,m)
n=int(input())
dfs("",n,1)
# Judge status: Accepted
n,k=map(int,input().split())
a=[int(x) for x in input().split()]
ans=(n-1)//(k-1)
if (n-1)%(k-1)!=0:
  ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
AB = [list(map(int,input().split())) for i in range(N)]
AB.sort(key=lambda x:x[1])
time = 0
ans = "Yes"
for i in range(N):
    time += AB[i][0]
    if time > AB[i][1]:
        ans = "No"
        break
print(ans)
# Judge status: Wrong Answer
import itertools
n=int(input())
r=[]
for s in itertools.combinations_with_replacement('abcdefghij'[:n],n):
    for _r in r:
        for i in range(n):
            if ord(_r[0])-ord(_r[i]) != ord(s[0])-ord(s[i]):
                break
        else:
            break
    else:
        r.append(s)
for i in range(len(r)):
    print(''.join(r[i]))
# Judge status: Wrong Answer

# ABC131
# A Security
S  = input()
sl = len(S)
for i in range(sl-1):
    if S[i] == S[i-1]:
        print('Bad')
        exit()
print('Good')
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
 
from collections import Counter
c = Counter(A)
 
mul = []
for k, v in c.items():
    if v >= 2:
        mul.append(k)
    if v >= 4:
        mul.append(k)
mul.sort()
if len(mul) < 2:
    print(0)
else:
    print(mul[-1]*mul[-2])
# Judge status: Wrong Answer
line1 = input('')
line2 = input('') 
result = True
cnt = int(line1)
list = line2.split(' ')
if len(list) != cnt:
  result = False
if result:
  for no_str in list:
    no = int(no_str)
    if no % 2 == 0:
      print(no)
      if no % 3 != 0 and no % 5 != 0:
        print(no)
        result = False

if result :
  print('APPROVED')
else:
  print('DENIED')
# Judge status: Accepted
# A - Triangle
S = int(input())
N = int(10**9)
y1 = (-S)%N
x1 = (S+y1)//N
print(x1,y1,1,N,0,0)
# Judge status: Accepted
ans=0
n=int(input())
res=0
a=list(map(int,input().split()))
b=sum(a)//n
c=b+1
for i in a:
    ans+=abs(i-b)**2
    res+=abs(i-c)**2
print(min(ans,res))
# Judge status: Accepted
a,b = map(int, input().split())
if a > 0:
  print("Positive")
elif b<0:
  if((b-a)%2 == 0):
    print("Negative")
  else:
    print("Positive")
else:
  print("Zero")
# Judge status: Accepted
n = int(input())
As = list(map(int, input().split()))
mx = 0
ans = 0
for a in As:
    if mx < a:
        mx = a
    else:
        ans += mx - a
print(ans)
# Judge status: Accepted
from fractions import gcd

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

L = [-1] * (N-1)
L[0] = A[0]
R = [-1] * (N-1)
R[0] = A[-1]

for i in range(1, N-1):
    L[i] = gcd(L[i-1], A[i])
    
for i in range(1, N-1):
    R[i] = gcd(R[i-1], A[-i-1])

ans = 0
for i in range(1, N-1):
    tmp = gcd(L[i-1], R[N-i-2])
    ans = max(ans, tmp)

ans = max(ans, L[N-2])
ans = max(ans, R[N-2])
print(ans)
# Judge status: Accepted
K, X = map(int, input().split())
print(' '.join([str(i) for i in range(X - K + 1, X + K)]))
# Judge status: Accepted
s=list(input())
count=0
for i in range(0,len(s),2):
    if s[i]=='L':
        count+=1

for j in range(1,len(s),2):
    if s[j]=='R':
        count+=1

if count==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,A,B = map(int,input().split())

sum = 0

for i in range(1,N+1):
    small_sum =0
    for j in list(str(i)):
        small_sum += int(j)
    if small_sum >= A and small_sum <= B:
        sum += i
print(sum)
# Judge status: Accepted
n,m=map(int,input().split())
a=[int(ss) for ss in input().split()]
a=sorted(a,reverse=True)
r="Yes"
for ii in range(m):
  if a[ii]<sum(a)/(4*m):
    r="No"
    break
print(r)
# Judge status: Accepted
N,K = map(int,input().split())

s = set()

#K種類ループ
for i in range(K):
  d = int(input())
  ad = list(map(int,input().split()))
  for a in range(d):
    s.add(ad[a])

print(N - len(s))
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
answer = 0
temp = 0
for i in range(N - 1):
    if H[i] < H[i + 1]:
        answer = max(answer, temp)
        temp = 0
    else:
        temp += 1
        answer = max(answer, temp)
print(answer)
# Judge status: Accepted
N = int(input())
sumN = N*(N+1)/2
sumFizz = ((N//3)*((N//3)+1))*3/2
sumBuzz = ((N//5)*((N//5)+1))*5/2
sumFizzBuzz = ((N//15)*((N//15)+1))*15/2
print(int(sumN - sumFizz - sumBuzz + sumFizzBuzz))
# Judge status: Accepted
def main():
    n, x = map(int, input().split())
    num_list = list(map(int, input().split()))

    ans = 0
    num_list.sort()

    for num in num_list:
        if x - num >= 0:
            x -= num
            ans += 1
        else:
            break

    if ans == n and x > 0:
        ans -= 1

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
nn=int(input())
ans=0

for i in range(nn-2):
    c=i+1
    for j in range(1,nn-c-1):
        if (nn-c) % j ==0:
            ans=ans+1
    ans=ans+1

ans=ans+2

print(ans)
# Judge status: Accepted
print('A' + input().split()[1][0] + 'C')
# Judge status: Accepted
N, M = map(int, input().split())
H = list(map(int, input().split()))

badN = set()
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1]==H[B-1]:
        badN.add(A)
        badN.add(B)
    elif H[A-1]>H[B-1]:
        badN.add(B)
    else:
        badN.add(A)

print(N-len(badN))
# Judge status: Accepted
s = list(input())
odd = set(s[::2])
even = set(s[1::2])
if 'L' in odd or 'R' in even:
    print("No")
else:
    print('Yes')
# Judge status: Accepted
a="Heisei"
S=input()
if int(S[5:7])<=4:
    print(a)
else:
    print("TBD")
# Judge status: Accepted
A, B, C, K = map(int, input().split())

if K % 2 == 0:
    print(A - B)
else:
    print(B - A)
# Judge status: Wrong Answer
import sys

input = sys.stdin.readline


def main():
    N = int(input())

    dp = [0] * (10 ** 5 + 1)
    dp[1] = 1

    x = [1]
    x.extend([6 ** x for x in range(1, 7)])
    x.extend([9 ** x for x in range(1, 5)])


    for i in range(2, 10 ** 5 + 1):
        tmp = []
        for v in x:
            if i >= v:
                tmp.append(dp[i - v] + 1)

        dp[i] = min(tmp)

    print(dp[N])


if __name__ == '__main__':
    main()
# Judge status: Accepted
# Code for C - Rectangle Cutting
# Use input() to fetch data from STDIN
[d, w, x, y] = [int(x) for x in input().split()]

m = d * w / 2

r = 1 if d / 2 == x and w / 2 == y else 0

print(m, r)
# Judge status: Accepted
N = int(input())
S = input()
if N % 2 == 1:
    print("No")
else:
    S1 = S[:N//2]
    S2 = S[N//2:]
    if S1 == S2:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
a = list(map(int, input().split()))
a.sort()
if a[0] + a[1] == a[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from itertools import permutations
import math

n = int(input())
x = []
y = []
for i in range(n):
    xi, yi = map(int, input().split(' '))
    x.append(xi)
    y.append(yi)

list = [i for i in range(n)]

total = 0
for i in permutations(list):
    norm = 0
    for j in range(n-1):
        X = x[i[j+1]] - x[i[j]]
        Y = y[i[j+1]] - y[i[j]]
        norm += math.sqrt(X**2 + Y**2)
    total += norm
print(total/math.factorial(n))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
A.sort()
print(sum(A[::2]) - sum(A[1::2]))
# Judge status: Accepted
n = int(input())
if n % 1000 == 0:
    print(0)
else:

    print(1000 -(n % 1000))
# Judge status: Wrong Answer
a, b = map(int, input().split())
s = [0] * 1002
for i in range(1002):
  s[i] = s[i - 1] + i
  if (s[i] == a): print(i)
  if (s[i - 1] - a == s[i] - b):
    print(s[i - 1] - a)
    break
print(s)
# Judge status: Accepted
l = list(map(int, input().split()))

L = sorted(l)
print(L[0] + int(str(L[2]) + str(L[1])))
# Judge status: Wrong Answer
s = list(input())

count = 0

for i in range(1, len(s)):
    if s[i-1] == s[i]:
        count += 1

        if s[i] == '1':
            s[i] = '0'
        else:
            s[i] = '1'

print(count)
# Judge status: Accepted
abc = list(map(int, input().split()))
abc.sort(reverse=1)
print(abc[0] * 10 + abc[1] + abc[2])