peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x,y = map(int,input().split())
count = 1

if x*y > 0:
  if x < y:
    count = y - x
  elif x > y:
    count = 2 + abs(y-x)
  elif abs(x) == abs(y):
    count = 0
elif x*y < 0:
  if x > y or x < y:
    count = 1 + abs(abs(x) - abs(y))
  elif abs(x) == abs(y):
    count = 0
else:
  if x != 0:
    count = abs(x)
    if x > 0:
      count += 1
  elif y != 0:
    count = abs(y)
    if y < 0:
      count += 1
  else:
    count = 0

print(count)
# Judge status: Wrong Answer
N = int(input())
n=int(N**0.5)
cnt=0
for i in range(1,n+1):
    a=N//i
    if a-i-1>0:
        cnt+=(a-i-1)*2
    if i**2!=N:
        cnt+=1
    if a*i<=N-1:
        cnt+=2
print(cnt)
# Judge status: Accepted
import math

N = int(input())

num = math.factorial(N)

k, r = divmod(num, 10**9 + 7)
print(r)
# Judge status: Accepted
s=input()

ans=1
cur,before='',s[0]
for i in range(1,len(s)):
    cur+=s[i]
    if cur!=before:
        ans+=1
        before=cur
        cur=''
print(ans)
# Judge status: Accepted
N,A,B = map(int,input().split())
ans = 0
for i in range(N+1):
    n = i
    sum = 0
    while n > 0:
        sum += n % 10
        n = int(n/10)
    if(A<=sum<=B):
        #print(sum,i)
        ans += i
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    count = 0
    ans = 0
    mi = float("inf")

    for a in A:
        ans += abs(a)
        mi = min(mi, abs(a))
        if a <= 0:
            count += 1

    if count & 1:
        print(ans - mi * 2)
    else:
        print(ans)

    
    

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n,m= list(map(int, input().split()))
if n>=m*2:
    print(m//2+(n-m//2)//2)
else:
    print(n+(m-n*2)//4)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
from fractions import gcd
l,r = [0]*(n+1),[0]*(n+1)
for i in range(n):
    l[i+1] = gcd(l[i],a[i])
for i in range(n,0,-1):
    r[i-1]= gcd(r[i],a[i-1])
ans = 0
for i in range(n):
    ans = max(ans,gcd(l[i],r[i+1]))
print(ans)
# Judge status: Accepted
S = list(str(input()))
if S[0] != S[1] and S[1] != S[2] and S[2] != S[3]:
    print('Good')
else:
    print('Bad')
# Judge status: Accepted
A, B, C = map(int, input().split())

for i in range(36):
    if A % 2 or B % 2 or C % 2:
        break

    tA = (B + C) // 2
    tB = (A + C) // 2
    tC = (B + A) // 2
    A = tA
    B = tB
    C = tC
else:
    i = -1

print(i)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    W,H,x,y = mi()

    ans = '{:.10f}'.format(W*H/2)
    ans2 = 1 if x==W/2 and y==H/2 else 0
    print(ans,ans2)
    




if __name__ == "__main__":
    main()
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

x = [True for _ in range(n)]

ans = 0
for i in range(n):
    if k <= i and x[i - k] and t[i] == t[i - k]:
        x[i] = False
    else:
        if t[i] == 'r':
            ans += p
        elif t[i] == 's':
            ans += r
        else:
            ans += s
print(ans)
# Judge status: Accepted
s = list(input())
s1 = ''.join(s[:2])
s2 = ''.join(s[2:])
flag1 = False
flag2 = False
if 1 <= int(s1) and int(s1) <= 12:
  flag1 = True
if 1 <= int(s2) and int(s2) <= 12:
  flag2 = True
if flag1 and flag2:
  print('AMBIGUOUS')
elif flag1:
  print('MMYY')
elif flag2:
  print('YYMM')
else:
  print('NA')
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
count = Counter(A)
keys = list(count.keys())
keys.sort(reverse = True)
a = 0
b = 0
for k in keys:
    if a == 0:
        if count[k] >= 4:
            a = b = k
            break
        elif count[k] >= 2:
            a = k
    else:
        if count[k] >= 2:
            b = k
            break
print(a * b)
# Judge status: Accepted
import math
X = int(input())
m = 100
y = 1
while True:
    m += math.floor(m * 0.01)
    if m >= X:
        print(y)
        break
    y += 1
# Judge status: Accepted
def solve(n):
    res = 0
    for i in range(1, n + 1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            res += i
    return res


def main():
    n = int(input())
    res = solve(n)
    print(res)


def test():
    assert solve(15) == 60
    assert solve(1000000) == 266666333332


if __name__ == "__main__":
    test()
    main()
# Judge status: Accepted
d, n = map(int, input().split())

if d==0 and n==100:
    print(101)
elif d==1 and n==100:
    print(10100)
elif d==2 and n==100 :
    print(1010000)
else:
    base = 100**d
    print(base*n)
# Judge status: Wrong Answer
import itertools

N = int(input())
li = input().split()
tmp = int(li.pop(0))
tmp = len(list(itertools.permutations(range(N), tmp)))
res = list()
res.append(tmp)
m = min(res)
for item in li:
  item = int(item)
  tmp = len(list(itertools.permutations(range(N), item)))
  if tmp <= m:
    res.append(tmp)
  m = min(res)

print(len(res))
print(res)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if (e-a) <= k :
    print("Yay!")
else :
    print(":(")
# Judge status: Accepted
import numpy

N, D = map(int, input().split())
X = [0] * N
Y = [0] * N
count = 0
for i in range(N):
    X[i], Y[i] = map(int, input().split())
    if numpy.sqrt(X[i]**2 + Y[i]**2) <= D:
        count += 1
print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
m = a[-1]
c = [0] * (m + 1)

for ai in a:
    for i in range(ai, m + 1, ai):
        c[i] += 1

ans = 0
for ai in a:
    if c[ai] == 1:
        ans += c[ai]

print(ans)
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
sumA = sum(A)

for i in range(N):
  num = min(A[i], B[i])
  A[i] -= num
  B[i] -= num
  
  if B[i]:
    num = min(A[i+1], B[i])
    A[i+1] -= num
    
print(sumA - sum(A))
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

n,k,s = iim()
ans = [s]*k+[1 if s==1000000000 else 1000000000]*(n-k)
print(*ans)
# Judge status: Accepted
X = int(input())
list = []

if X == 1:
  list.append(1)

#2^2からスタートするため、X=3も例外として加えなければならない
elif X == 2 or X == 3:
  list.append(2)
  
else:
  for b in range(2, X):
    p = 2
    #X自身になったときに処理できないので
    #<=が必要
    while b ** p <= X:
      list.append(b ** p)
      p += 1
      
print(max(list))
# Judge status: Accepted
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N, K = map(int, input().split())
    S = input()
    ret = 0
    for i in range(1,N-1):
        if (S[i]=='L' and S[i-1]=='L') or (S[i]=='R' and S[i+1]=='R'):
            ret += 1
    if S[0]=='R' and S[1]=='R':
        ret += 1
    if S[N-1]=='L' and S[N-2]=='L':
        ret += 1

    print(min(N-1,ret+2*K))

if __name__ == '__main__':
    main()
# Judge status: Accepted
a = list(map(int, input().split()))
a.sort()

if a[0] % 2 == 0 or a[1] % 2 == 0 or a[2] % 2 == 0:
    print(0)
else:
    print(a[0] * a[1])
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))

one = A.index(1)

print((one+1)//(K-1) + (N-one)//(K-1))
# Judge status: Accepted
import sys


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


import fractions


def resolve():
    a, b = map(int, input().split())
    print((a * b) // fractions.gcd(a, b))
resolve()
# Judge status: Wrong Answer
N, M = map(int,input().split())
ans = 0
for i in range(max(0,M//2-N-3), max(0, M//2-N+3)):
    ans = max(ans,min(N+i//2,(M-i)//2))
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = [int(i) for i in input().split()]

same = True
for i in range(N):
    a = A[i]
    if i > 0 and a != A[i-1]:
        same = False
    if a % 2 == 1:
        print(1)
        break
else:
    if same:
        print(A[0])
    else:
        print(2)
# Judge status: Wrong Answer
# ABC153
# C

N, K = input().split()
H_list = input().split()
H_list.sort(reverse=True)

count = 0
for i in range(int(K),len(H_list)):
    count += int(H_list[i])

print(count)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
if max(a) != min(a):
    while a.count(0) != len(a)-1:
        print(a)
        a.sort()
        b = [a[0]]
        for i in a[1:]:
            if i%a[0] != 0:
                b.append(i%a[0])
        a = b
    print(max(a))
else:
    print(a[0])
# Judge status: Wrong Answer
sx,sy,tx,ty = map(int,input().split())

x_diff = tx-sx
y_diff = ty-sy

up = 'U'*abs(y_diff)
down = 'D'*abs(y_diff)
left = 'L'*abs(y_diff)
right = 'R'*abs(y_diff)

ans = down+left+up+right
ans = 'RD'+down+left+'LU'+'LU'+up+right+'RD'+ans

print(ans)
# Judge status: Accepted
import sys

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


a, b = nm()
if a >= 13:
    print(b)
elif 6 <= a <= 12:
    print(b // 2)
else:
    print(0)
# Judge status: Wrong Answer
n = list(input())
n.sort()
print(n[2] * 3)
# Judge status: Wrong Answer
N,A,B = map(int,input().split())

N_sum = 0

for i in range(N+1):
    j = i
    if j >= 10:
        j = list(str(j))
        j = int(j[0]) + int(j[1])
    if j >= A and j <= B:
        N_sum += i
        
print(N_sum)
# Judge status: Wrong Answer
n,k=map(int,input().split())
S=input()+'R'
c=0
d=0
for i in range(n):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1
print(c+2*k if d>k else c+2*k-1)
# Judge status: Accepted
import math

A,B,H,M = map(int, input().split())

Md = M * 360 / 60
Hd = H * 30 + M * 30 / 60

MHd = abs(Md - Hd)

if MHd > 180 :
    MHd = 360 - MHd

ans = A**2 + B**2 - 2 * A * B *  math.cos(math.radians(MHd))
# print(math.cos(math.radians(60)))

print (math.sqrt(ans))
# Judge status: Accepted
s,w =map(int,input().split())

if s <= w:
    print('unsafe')
else:
    print('safe')
# Judge status: Accepted
x = int(input())
ans = 0
for i in range(x, 0, -1):
  for j in range(2, max(x + 1, 3)):
    if pow(i, j) <= x:
      ans = max(ans, pow(i, j))
    else:
      break
print(ans)
# Judge status: Accepted
S = input()
x = len(S)
ans = [0] * (x+1)
for i in range(x):
    if S[i] == '<':
        ans[i+1] = ans[i] + 1 
for i in range(x-1,-1,-1):
    if S[i] == '>':
        ans[i] = max(ans[i],ans[i+1]+1)
print(sum(ans))
# Judge status: Wrong Answer
n = input()
ans = 0
accu = 0
for i, j in enumerate(n):
    j = int(j)
    if j>0:
        ans = max(ans, accu+j-1+9*(len(n)-i-1))
    accu += j
print(ans)
# Judge status: Accepted
a=list(map(int,input().split('/')))
print('TBD' if a[1]>4 else 'Heisei')
# Judge status: Accepted
#template
def inputlist(): return [int(j) for j in input().split()]
from collections import Counter
#template
#issueから始める
H=int(input())
W = int(input())
N = int(input())
m = max(H,W)
n=N/m
if n.is_integer():
    print(int(n))
    exit()
else:
    print(int(n)+1)
# Judge status: Wrong Answer
n,m = map(int,input().split())
 
lis = [[] for i in range(n)] #なぜか知らんけど[[]]*nじゃだめらしい
 
for i in range(m):
  a,b = map(int,input().split())
  lis[a-1].append(b-1)
  lis[b-1].append(a-1)

print(lis)
  
for i in lis[0]:
  if i in set(lis[-1]):
    print('POSSIBLE')
    exit()
# Judge status: Accepted
import heapq

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

a = [-int(x) for x in input().split()]

heapq.heapify(a)

num = 0
hq = 1

while num < M and hq != 0:
    hq = -heapq.heappop(a)
    hq2 = hq // 2
    heapq.heappush(a, -hq2)
    num += 1

print(-sum(a))
# Judge status: Accepted
x, y = map(int, input().split())

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

print(ans)
# Judge status: Wrong Answer
#coding:utf-8
import numpy as np
n,k=map(int,input().split())
P=list(map(int,input().split()))

s=[(1/2)*x*(x+1)/x for x in P]
number=len(P)-k+1
print(np.max(np.convolve(s,np.ones(number)/number,mode='same'))*number)
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=input()
a=[]
cnt=0
flag=s[0]
for i in range(1,n):
  if flag==s[i]:cnt+=1
  else:
    flag=s[i]
    a+=[cnt]
    cnt=0
a+=[cnt]
l=sorted(a[::2])[::-1]
r=sorted(a[1::2])[::-1]
print(min(max(sum(r[:k])+sum(l),sum(r)+sum(l[:k]))+2*k,n-1))
# Judge status: Accepted
c_1 = list(map(int, input().split()))
c_2 = list(map(int, input().split()))
c_3 = list(map(int, input().split()))

diff = []

for i in range(2):
    diff.append(c_1[i] - c_1[i+1])

if c_2[0] - c_2[1] != diff[0] or c_2[1] - c_2[2] != diff[1]:
    print("No")
    exit()

if c_3[0] - c_3[1] != diff[0] or c_3[1] - c_3[2] != diff[1]:
    print("No")
    exit()

print("Yes")
# Judge status: Accepted
n = int(input())
s = input()
x = ans = 0

 
for i in range(n):
  if s[i] == "I":
    x += 1
  else:
    x -= 1
  ans = max(ans,x)
    
print(ans)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

A, B = mi()

if A-1 >= B:
    print(2*A-1)
else:
    print(A+B)
# Judge status: Wrong Answer
N=input()
if N[0] == '7' or N[1] == 7 or N[2] == '7':
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

ans = 0
c = 0
c1 = 0
for i in range(1, n):
    if a[i] > a[i-1]:
        c1 = 1
    elif a[i] < a[i-1]:
        c1 = -1
    if c != c1 and c != 0:
        ans += 1
        c = 0
        continue
    c = c1

print(ans+1)
# Judge status: Accepted
s = input()
n = len(s)
ans = 1000
for i in range(n-2):
    a = '' + s[i] + s[i+1] + s[i+2]
    a = int(a)
    ans = min(ans, abs(a - 753))
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

if a > 0:
    result = "Positive"
elif a == 0:
    result = "Zero"
else:
    if b >= 0:
        result = "Zero"
    else:
        c = b - a
        if c % 2 == 0:
            result = "Negative"
        else:
            result = "Positive"
            
print(result)
# Judge status: Accepted
from sys import stdin

N, M = map(int, stdin.readline().split())

print(abs(N * M - 2 * (N + M) + 4))
# Judge status: Accepted
W, H, N = map(int, input().split())
d = [[0, W], [0, H]]
for i in range(N):
  x, y, a = map(int, input().split())
  if a == 1:
    d[0][0] = max(x, d[0][0])
  elif a == 2:
    d[0][1] = min(x, d[0][1])
  elif a == 3:
    d[1][0] = max(y, d[1][0])
  elif a == 4:
    d[1][1] = min(y, d[1][1])
print(max((d[0][1] - d[0][0]), 0) * max((d[1][1] - d[1][0]), 0))
# Judge status: Accepted
a, b = map(int, input().split())
if 0 < a and a <= b:
    print('Positive')
elif a <= b and b < 0:
    if (b-a+1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
else:
    print('Zero')
# Judge status: Accepted
import math
h, w, n = [int(input()) for i in range(3)]
m = 0
ans = math.ceil(n / max(h, w))
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
a=[[int(i) for i in input().split()] for i in range(m)]

possibility=[False]*n
possibility[0]=True
count=[1]*n

for x,y in a:
    if possibility[x-1]==True and count[x-1]>1:
        possibility[y-1]=True
    elif possibility[x-1]==True and count[x-1]==1:
        possibility[x-1]=False
        possibility[y-1]=True
    count[x-1]-=1
    count[y-1]+=1

print(possibility.count(True))
# Judge status: Accepted
a,b,c = map(int,input().split())
if (c>a and c<b) or (c>b and c<a):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n, m = map(int, input().split())
H = list(map(int, input().split()))
# AB = [list(map(int, input().split())) for _ in range(m)]

edges = [[] for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)

ans = 0
for idx, e_list in enumerate(edges):
    bl = True
    if len(e_list) != 0:
        for e in e_list:
            if H[idx] <= H[e]:
                bl = False
    if bl:
        ans += 1

print(ans)
# Judge status: Accepted
c = [list(map(int, input().split())) for _ in range(3)]

a = sum(c[0]) + sum(c[1]) + sum(c[2])
b = c[0][0] + c[1][1] + c[2][2]

print('Yes' if a == 3 * b else 'No')
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

d=[]
for i in range(N):
    d.append(a[i]-b[i])

cnt=-sum(d)
n=0
for j in range(N):
    if d[j]<0:
        n+=-d[j]//2
if n<cnt:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b=map(int,input().split())
num=list(input())
non=False

for (i,c) in zip(range(0,a+b+1),num):
  if c=="-":
    if i==a:
      continue
    else:
      non=True
      break
  elif i==a:
    non=True
    break
    
if non:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
x, a, b = map(int, input().split())

if b<=a:
    print('delicious')
elif b-a <=x:
    print('safe')
else:
    print('dangerouse')
# Judge status: Accepted
import sys

s = input()
t = input()

finalans = 1000000
for i in range(len(s) - len(t) + 1):
    ans = 0
    for j in range(len(t)):
        if (s[i+j] == t[j]):
            pass
        else:
            ans += 1
    finalans = min(finalans, ans)

print(finalans)
# Judge status: Wrong Answer
n,d = map(int,input().split())

x = [list(map(int,input().split())) for _ in range(n)]

ans = 0

for i in range(n-1):
    for j in range(i+1,n):
        sub = 0
        for k in range(d) :
            sub += abs(x[i][k]-x[j][k])**2
        sub = sub**0.5
        print(sub)
        if sub.is_integer() :
            ans += 1

print(ans)
# Judge status: Wrong Answer
import sys
from collections import defaultdict

s = list(map(str, input().rstrip()))
t = list(map(str, input().rstrip()))

d = defaultdict(str)

for x, y in zip(s, t):
    if d[y] == "" or d[y] == x:
        d[y] = x
    else:
        print("No")
        sys.exit()

else:
    print("Yes")
# Judge status: Wrong Answer
import bisect
n = int(input())
li = list(map(int,input().split()))
li.sort()
#print(li)
count = 0
for i in range(1, max(li)):
    index = bisect.bisect_left(li, i)
    #print(n,index,n//2)
    if index == n//2:
        #print(index)
        count += 1
print(count)
# Judge status: Wrong Answer
import math
from sys import stdin,stdout
#% 998244353
from heapq import heapify,heappop,heappush
import collections


a,s1=list(map(int,stdin.readline().split()))
b,s2=list(map(int,stdin.readline().split()))
T = int(stdin.readline())

if a+s1*T>=b+s2*T:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())
min_num = min(X, Y)
max_num = min(X, Y)
min_price = min(A + B, C * 2)
max_price = min(A + B, C * 2)
answer = min_num * min_price
# print(answer)

if X >= Y:
    answer += (X - min_num) * min(A, C * 2)
else:
    answer += (Y - min_num) * min(B, C * 2)

print(answer)
# Judge status: Accepted
a,b,c=map(int,input().split());print("NYoe s"[a<c<b or a>c>b::2])
# Judge status: Wrong Answer
n=int(input())
king=int(0)
ans=int(0)
for i in range(1,n+1):
    a=i
    count=int(0)
    while a:
        if a%2==0:
            a/=2
            count+=1
        
        else:
            break

    if king<count:
        king=count
        ans=i

print(ans)
# Judge status: Wrong Answer
x=int(input())
for a in range(100):
    for b in range(-100,100):
        if (a**5 - b**5) == x:
            print(a,b)
            exit()
# Judge status: Wrong Answer
K=int(input())
a=[0]*(K+1)
a[1]=7%K
for i in range(2,K+1):
  a[i]=(a[i-1]*10+7)%K
  if a[i]==0:
    print(i)
    exit()
print(-1)
# Judge status: Accepted
a, b, c = map(int, input().split())
s = a+b+c
if (s>21):
  print('bust')
else: 
  print('win')
# Judge status: Accepted
# -*- coding: utf-8 -*-

###
# main
if(__name__ == '__main__'):
    # input
    x, y, z = map(int, input().split(" "))

    x, y = y, x
    x, z = z, x

    print(str(x)+" "+str(y)+" "+str(z))

# else:
    # do nothing
# Judge status: Accepted
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
  if str(i) == str(i)[::-1]: ans += 1
print(ans)
# Judge status: Accepted
l = int(input()) 

print((l/3)*(l/3)*(l/3))
# Judge status: Wrong Answer
N, K = list(map(int, input().split()))
enemy = sorted(list(map(int, input().split())), reverse=True)
 
if K > len(enemy):
  print(0)
  
sum = 0
for x in enemy[K:]:
  sum += x
print(sum)
# Judge status: Wrong Answer
n = int(input())
a = [0] + list(map(int,input().split()))

def binp(arr, val):
    left,right = 0,len(arr)-1
    while left <= right:
        mid = (left+right)//2
        if val==arr[mid]: return 1
        elif val>=arr[mid]: left = mid+1
        else: right = mid-1
    return 0

ap = [a[i] + i for i in range(1,n+1)]
an = [a[i] - i for i in range(1,n+1)]
an.sort()



ans = 0
for ele in ap:
    if binp(an,-ele): ans += 1

print(ans)
# Judge status: Accepted
def main():
    from itertools import product, zip_longest

    s = input()

    for prod in product('+-', repeat=3):
        formula = ''
        for x, op in zip_longest(s, prod, fillvalue=''):
            formula += x + op
        if eval(formula) == 7:
            print('{}=7'.format(formula))
            return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import collections

n=int(input())
a=list(map(int,input().split()))
a=collections.Counter(a)
a=sorted(a.items(),reverse=True)
#print(a)

tm=0

for i in range(n):
    if a[i][1]>=4:
        print(a[i][0]*a[i][0])
        exit()
    elif a[i][1]>=2:
        if tm==0:
            tm=a[i][0]
        else:
            print(tm*a[i][0])
            exit()

print("0")
# Judge status: Wrong Answer
def main():
    n,k = map(int,input().split())
    p = list(map(int,input().split()))
    p.sort()
    print(sum(p[:3]))
if __name__=='__main__':
    main()
# Judge status: Accepted
Nf,Af,Bf = (input().split(' '))
N = int(Nf)
A = int(Af)
B = int(Bf)
a = N % (A + B)
b = N // (A + B)

if a < A + 1:
  print(A*b+a)
else:
  print(A*b+A)
# Judge status: Accepted
n,k = map(int, input().split())
l = list(map(int,input().split()))
ok = max(l)
ng = 0

def solver(x):
    cnt = 0
    for logs in l:
        if logs % x == 0:
            cnt += (logs // x) -1
        else:
            cnt += logs// x
    if cnt <= k:
        return True
    else:
        return False

while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    if solver(mid) == True:
        ok = mid
    else:
        ng = mid

print(ok)
# Judge status: Accepted
import collections

n = int(input())
s = input()
l1 = []
l2 = []
ans = 0
for i in range(1,n):
  l1 = set(list(s[0:i:]))
  l2 = set(list(s[i::]))
  ans = max(ans,len(l1&l2))
#  print(l1,l2,ans)
  
print(ans)
# Judge status: Accepted
import sys
import collections as cc
input = sys.stdin.readline
I=lambda:list(map(int,input().split()))
n,w=I()
val=[]
wt=[]
for i in range(n):
	x,y=I()
	wt.append(x)
	val.append(y)
dp=[[0]*(w+1) for i in range(n+1)]
for i in range(1,n+1):
	for j in range(1,w+1):
		if wt[i-1]<=j:
			dp[i][j]=max(val[i-1]+dp[i-1][j-wt[i-1]],dp[i-1][j])
		else:
			dp[i][j]=dp[i-1][j]
print(dp[n][w])
# Judge status: Wrong Answer
N,L = map(int,input().split())
count = L
taste = []
for i in range(N):
    taste.append(count)
    count += 1
if 0 in taste:
    taste.remove(0)
elif  N + L <= 0:
    taste.pop(-1)
else:
    taste.pop(0)
print(taste)
# Judge status: Wrong Answer
import numpy as np

MOD = 10 ** 9 + 7

n=int(input()) #3
alst=list(map(int,input().split())) #[1,2,3]

# 累積和を求める

# 例
# [1,2,3,4,5,6]の時、累積和は、
# [0,1,3,6,10,15,21]

s=np.cumsum(alst,dtype='float32')

sum=0

for i in range(len(alst)-1):
  sum+=alst[i]*(s[len(s)-1]-s[i])

print(sum%MOD)
# Judge status: Wrong Answer
k, s = map(int, input().split())

l = set()
for i in range(k+1):
    for j in range(k+1):
        if i+j+k >= s:
            l.add((i, j, s-k-j))
        else:
            continue

print(len(l))
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a+b > 24:
  print('24-a-b')
else:
  print('a+b')