Harryxun/stf_run huggingface dataset:
#実験をしっかりとしよう
X,Y,Z,K = (int(_) for _ in input().split())
A = (int(_) for _ in input().split())
B = (int(_) for _ in input().split())
C = (int(_) for _ in input().split())
#この手の問題はまずsortする(今回は大きい順の方がすっきり)
A = sorted(A).reverse()
B = sorted(B).reverse()
C = sorted(C).reverse()
#総和は変わらないので残ったやつの累積和で考えてみる。
#1000*1000なら全列挙できるそのうち3000個を取り除いて、3の1000個を
#それに組み合わせて全探索する。(2重forかな)
AB = []

for i in range(X):
    for j in range(Y):
        AB.append(A[i]+B[i])
AB = sorted(AB).reverse()[:3001]

ABC = []
for i in range(len(AB)):
    for j in range(Z):
        ABC.append(AB[i]+C[j])

ABC = sorted(ABC).reverse()
for i in range(3000):
    print(ABC[i])


### FIXED CODE ###

#実験をしっかりとしよう
X,Y,Z,K = (int(_) for _ in input().split())
A = (int(_) for _ in input().split())
B = (int(_) for _ in input().split())
C = (int(_) for _ in input().split())
#この手の問題はまずsortする(今回は大きい順の方がすっきり)
A = sorted(A)
B = sorted(B)
C = sorted(C)
#Aのa位とb位とc位ならその上にはa*b*c-1(自分以外)が上にいる。
A.reverse()
B.reverse()
C.reverse()

ABC = []
for i in range(len(A)):
    for j in range(len(B)):
        if (i+1)*(j+1) > K:
            break
        for k in range(len(C)):
            if (i+1)*(j+1)*(k+1) > K:
                break
            ABC.append(A[i]+B[j]+C[k])
ABC.sort()
ABC.reverse()

for i in range(K):
    print(ABC[i])
#pythonだとTLEになる?
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
#sort = sorted(a)[::-1] 降順
import math
x, k, d = map(int, input().split())

num = k*d

x = abs(x)

if x >= num:
    print(x - num)
else:
    j = int(x / d)
    min = min(x % (d*j), d - (x % (d*j)))
    if min == d - (x % (d*j)):
        j += 1

    if (k - j) % 2 == 0:
        print(min)
    else:
        print(max(x % (d*j), d - (x % (d*j))))


### FIXED CODE ###

#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
#sort = sorted(a)[::-1] 降順
import math
x, k, d = map(int, input().split())

num = k*d

x = abs(x)
flag = 0

if x >= num:
    print(x - num)
else:
    if x > d:
        j = int(x / d)
    else:
        if x*2 > d:
            j = 1
            flag = 1
        else:
            j = 0

    if j == 0:
        b = x
    elif j == 1 and flag == 1:
        b = d - x
    else:
        b = x % (d*j)
    min = min(b, d - b)
    max = max(b, d - b)
    if min == d - b:
        j += 1

    if (k - j) % 2 == 0:
        print(min)
    else:
        print(max)
from tqdm import tqdm
for i in range(1, 20+1):
    ans=0
    for x in range(1, 10):
        for y in range(1, 10):
            for z in range(1, 10):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
                    ans+=1
                    #print(i, x,y,z)
    if ans != 0:
        print(ans)
    else:
        print(ans)

### FIXED CODE ###

n = int(input())
#from tqdm import tqdm
ans=[0 for _ in range(10001)]
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < 10001:
                ans[v]+=1
                #print(i, x,y,z)
for i in range(n):
    print(ans[i+1])
def power(x, n):
    if n == 0: return 1
    value = power(x, int(n / 2))
    value *= value
    if n % 2 == 1: value *= x
    return value

n = int(input())
x = list(input())

number = int(''.join(x), 2)
count = x.count('1')

def f(num, cnt):
    if num == 0:
        return cnt
    popcount = format(num, 'b').count('1')
    return f(num % popcount, cnt+1)

for i in range(n):
    if x[i] == '0':
        m = number + power(2, n-i-1)
        if m:
            print(f(m % (count+1), 1))
        else:
            print(0)
    if x[i] == '1':
        m = number + power(2, n-i-1)
        if m:
            print(f(m % (count-1), 1))
        else:
            print(0)
    


### FIXED CODE ###

n = int(input())
x = list(input())

count = x.count('1')
one_count = count - 1
zero_count = count + 1

one_mod = 0
zero_mod = 0
for b in x:
    if one_count:
        one_mod = (one_mod * 2 + int(b)) % one_count
    zero_mod = (zero_mod * 2 + int(b)) % zero_count

f = [0] * 2000001
pop_count = [0] * 200001
for i in range(1, 200001):
    pop_count[i] = pop_count[i//2] + i % 2
    f[i] = f[i % pop_count[i]] + 1

for i in range(n):
    if x[i] == '1':
        if one_count:
            nxt = one_mod
            nxt -= pow(2, n-i-1, one_count)
            nxt %= one_count
            print(f[nxt] + 1)
        else:
            print(0)
    if x[i] == '0':
        nxt = zero_mod
        nxt += pow(2, n-i-1, zero_count)
        nxt %= zero_count
        print(f[nxt] + 1)
def getMinSumPrice(x,y):
    return int(min(x)) + int(min(y))

def getMinCouponPrice(z):
    tmp = []
    for Arr in z:
        if int(Arr[0]) + int(Arr[1]) > int(Arr[2]):
            tmp.append(int(Arr[0]) + int(Arr[1]) - int(Arr[2]))
    return min(tmp)

A = input().split(" ")
a = input().split(" ")
b = input().split(" ")
C = []
for i in range(0, int(A[2])):
  val = input().split(" ")
  if val:
    C.append(val)

if getMinSumPrice(a, b) > getMinCouponPrice(C):
    print(getMinCouponPrice(C))
else:
    print(getMinSumPrice(a, b))

### FIXED CODE ###

import re

S = input()

hslist = ["hi","hihi","hihihi","hihihihi","hihihihihi"]

if S in hslist:
  print("Yes")
else:
  print("No")
def f(l, a, hist):
    if(l[a] in hist):
        return -1
    if(l[a] == 1):
        return len(hist)
    hist.append(l[a])
    return f(l,a,hist)

def solve():
    n = int(input())
    l = []

    for i in range(n):
        l.append(int(input()))
        
    print(f(l,l[0],[]))

if(__name__ == "__main__"):
    solve()


### FIXED CODE ###

def solve():
    n = int(input())
    l = []

    for i in range(n):
        l.append(int(input()))

    a = 1
    hist = set([])
    while(True):
        if(a-1 in hist):
            return -1
        if(a-1 == 1):
            return len(hist)
        hist.add(a-1)
        a = l[a-1]

if(__name__ == "__main__"):
    print(solve())
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
#from collections import Counter # a = Counter(A).most_common()
from itertools import accumulate #list(accumulate(A))
import math
    
N, K = mi()
A = li()
 
#light = [0] * (N+2)
#A = [0] + A + [0]
#print(math.log(N, 2))
'''
thre = 0
for i in range(N):
    if A[i] < i:
        thre = max(thre, i-A[i])
'''
if K > pow(N, 0.5) + 1:
        for i in range(N):
            print(N, '', end='')
        print()
        exit()
 
 
for i in range(K):
    new = [0] * (N+1)
    for j in range(N):
        new[max(j-A[j], 0)] += 1
        new[min(j+A[j]+1, N)] += -1
        #print(new)
    new = list(accumulate(new))
    A = new[:N]
 
for i in range(N):
    print(A[i], '', end='')
print()

### FIXED CODE ###

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
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

S = input()

print(S[:3])
while 1:
   x = input()
   y = input()
   if x == 0 and y == 0:
      break
   if x < y:
      print x y
   if x > y:
      print y x

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x <= y:
      print "%d %d" %(x, y)
   elif x > y:
      print "%d %d" %(y, x)
n = int(input())
for i in range(n):
	s = int(input())+int(input())
	if len(str(s))>=80:
		print("overflow")
	else
		print(a+b)

### FIXED CODE ###

n = int(input())
for i in range(n):
	s = int(input())+int(input())
	if len(str(s))>80:
		print("overflow")
	else:
		print(s)
n=int(input())
a=int(input())
b=int(input())
if n == 2:
    print(a+b)
else:
    print("Hello World")

### FIXED CODE ###

n=int(input())
if n == 1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
x,y,z = map(input().split())
print(x[:1]+y[:1]+z[:1])

### FIXED CODE ###

x,y,z = (input().split())
print((x[:1]+y[:1]+z[:1]).upper())
x,n,t = map(str,input().split(" "))
cnt =0
while (x > 0):
    x -= n
    cnt += 1
print(cnt * t)

### FIXED CODE ###

want, max, time = map(int, input().split())
if want % max == 0:
  required = int(want / max)
else:
  required = int(want / max + 1)
print(required * time)
x = input()
if int(x[2])=7:
    print(Yes)
else if int(x[1])=7:
    print(Yes)
else if int(x[0])=7:
    print(Yes)
else:
    print(No)

### FIXED CODE ###

N = input()
if int(N[2])==7:
    print("Yes")
elif int(N[1])==7:
    print("Yes")
elif int(N[0])==7:
    print("Yes")
else:
    print("No")
n,k = map(int,input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 5

for i in range(n-k+1):
    if h[i+k-1] - h[i] < ans:
        ans = h[i+2] - h[i]

print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 10

for i in range(n-k+1):
    ans = min(h[i+k-1] - h[i],ans)

print(ans)
n = int(input())
a = list(map(int, input().split()))

total = 0
for i in range(n - 1):
  temp = []
  for j in range(i + 1, n):
    temp.append((a[i]*a[j]) % (10**9 + 7))
  total += sum(temp) % (10**9 + 7)

print(total % (10**9 + 7))

### FIXED CODE ###

d, t, s = map(int, input().split())

if d / s > t:
  print('No')
else:
  print('Yes')
a,b = map(int,input.split())
c,d=map(int,input.split())
print((c-a)*(d-b))

### FIXED CODE ###

a,b = map(int,input().split())
c,d=map(int,input().split())
print((c-a)*(d-b))
#ABC122

s = input()

d = ["A","T","G","C"]
l = []
count = 0
for i in range(len(s)):
    if s[i] not in d:
        l.append(count)
        count = 0
    else:
        count += 1
    #print(count)
print(max(l))

### FIXED CODE ###

#ABC122

s = input()

d = ["A","T","G","C"]
l = []
count = 0
for i in range(len(s)):
    if s[i] not in d:
        l.append(count)
        count = 0
    else:
        count += 1
    #print(count)
l.append(count)
print(max(l))
N, M, X = map(int, input().split())
books = [input() for i in range(N)]
result = 12 * 10**5 + 1
for i in range(1, 1 << N):
  skill = [0 for i in range(N)]
  for j in range(N):
    if (i >> j) & 1:
      book = books[j].split()
      cost += int(book[0])
      for k in range(M):
        skill[k] += int(book[k + 1])
  if all(j >= X for j in skill):
    result = min(result, cost)
if result == 12 * 10**5 + 1:
  print(-1)
else:
  print(result)

### FIXED CODE ###

N, M, X = map(int, input().split(" "))
book_information = []
result = 12 * 10**5 + 1
for i in range(N):
	book_information.append(input())
for i in range(1, 1 << N):
  bought_book = []
  n = 0
  cost = 0
  skill = [0 for j in range(M)]
  for j in range(N):
    if (i >> j) & 1:
      bought_book.append(book_information[j])
      n += 1
  for j in range(n):
    bought_book_information = list(bought_book[j].split(" "))
    cost += int(bought_book_information[0])
    for k in range(M):
      skill[k] += int(bought_book_information[k + 1])
  if all(x >= X for x in skill):
    result = min(result, cost)
if result == 12 * 10**5 + 1:
  print(-1)
else:
  print(result)
def get_input():
      w = input()
      h = input()
      a = []
      for i in range(w):
            sub_a = []
            for j in range(h):
                  sub_a.append(raw_input())
            a.append(sub_a)
      return a

def transpose(mat):
      mat2 =[[row[i] for row in mat] for i in range(len(mat[0]))]
      return mat2

def get_output(mat):
      # done_flag = False
      point_count = 0
      i = 0
      while i<len(mat):
            j = 0
            while j<len(mat[0]):
                  if(mat[i][j] == '.'):
                        point_count += 1
                  j+=1            
            
            if point_count == len(mat[0]):
                  del mat[i]
                  i = 0
                  point_count = 0
                  continue
            i+=1
            point_count = 0
            print(mat)

      mat = transpose(mat)

      point_count = 0
      i = 0
      while i<len(mat):
            j = 0
            while j<len(mat[0]):
                  if(mat[i][j] == '.'):
                        point_count += 1
                  j+=1            
            
            if point_count == len(mat[0]):
                  del mat[i]
                  i = 0
                  point_count = 0
                  continue
            i+=1
            point_count = 0
            print(mat)

      return transpose(mat)

if __name__ == '__main__':
    mat = get_input()
    mat2 = get_output(mat)

    print mat2

# del a[1]

### FIXED CODE ###

h, w = [int(n) for n in input().split()]
grid = [input() for _ in range(h)]
row_hashs = set()
column_hashs = set()

for i, row in enumerate(grid):
    for j, ch in enumerate(row):
        if ch == '#':
            row_hashs.add(i)
            column_hashs.add(j)

new_grid = []

for i, row in enumerate(grid):
    if i not in row_hashs:
        continue
    new_grid.append([])
    for j, ch in enumerate(row):
        if j not in column_hashs:
            continue
        new_grid[-1].append(ch)
    new_grid[-1] = "".join(new_grid[-1])


print("\n".join(new_grid))
# print(*new_grid, sep="\n")
print((int(input())+1//2)

### FIXED CODE ###

import math
N=int(input())
print(math.ceil(N/2))
N, M = map(int, input().split())
inf = float("inf")
dp = [[inf]*10 for _ in [0]*10]
for i in range(N):dp[i][i] = 0
d = [list(map(int, input().split())) for i in range(10)]
m = [list(map(int, input().split())) for i in range(N)]
ans = 0
 
for i in range(10):
    for j in range(10):
        dp[i][j] = d[i][j]
for k in range(10):
    for i in range(10):
        for j in range(10):
            dp[i][j] = min(dp[i][j],dp[i][k]+dp[k][j])
c=0
for i in range(N):
    for j in range(M):
        if m[i][j] != 1 :
            if m[i][j] != -1 :
                c+=dp[m[i][j]][1]
print(c)

### FIXED CODE ###

N, M = map(int, input().split())
inf = float("inf")
dp = [[inf]*100 for _ in [0]*100]
for i in range(10):dp[i][i] = 0
d = [list(map(int, input().split())) for i in range(10)]
m = [list(map(int, input().split())) for i in range(N)]
ans = 0
 
for i in range(10):
    for j in range(10):
        dp[i][j] = d[i][j]
for k in range(10):
    for i in range(10):
        for j in range(10):
            dp[i][j] = min(dp[i][j],dp[i][k]+dp[k][j])
c=0
for i in range(N):
    for j in range(M):
        if m[i][j] != 1 :
            if m[i][j] != -1 :
                c+=dp[m[i][j]][1]
print(c)
N,Q=map(int, input().split())
s=input()
S=len(s)
A=[]
for i in range(Q):
  x,y=input().split()
  A.append((x,y))
  
if N==1:
  for x,y in A:
    if s[0]==x:
      print(0)
      exit()
  print(1)
  exit()
  
def L(d):
  for x,y in A:
    if s[d]==x and y=='L':
      d-=1    
    if s[d]==x and y=='R':
      d+=1
    if d<0:
      return False
  return True

ok,ng=S,-1
mid=(ok+ng)//2
while abs(ok-ng)>1:
  mid=(ok+ng)//2
  if L(mid):
    ok=mid
  else:
    ng=mid
p=ok
if ok==S:
  print(0)
  exit()

def R(d):
  for x,y in A:
    if s[d]==x and y=='L':
      d-=1    
    if s[d]==x and y=='R':
      d+=1
    if d>=S:
      return False
  return True

ok,ng=-1,S
mid=(ok+ng)//2
while abs(ok-ng)>1:
  mid=(ok+ng)//2
  if R(mid):
    ok=mid
  else:
    ng=mid
q=ok

print(q-p+1)

### FIXED CODE ###

N,Q=map(int, input().split())
s=input()
S=len(s)
A=[]
for i in range(Q):
  x,y=input().split()
  A.append((x,y))
  
if N==1:
  for x,y in A:
    if s[0]==x:
      print(0)
      exit()
  print(1)
  exit()
  
def L(d):
  for x,y in A:
    if s[d]==x and y=='L':
      d-=1    
    if s[d]==x and y=='R':
      d+=1
    if d<0:
      return False
    elif d==S:
      d-=1
  return True

ok,ng=S,-1
mid=(ok+ng)//2
while abs(ok-ng)>1:
  mid=(ok+ng)//2
  if L(mid):
    ok=mid
  else:
    ng=mid
p=ok
if ok==S:
  print(0)
  exit()

def R(d):
  for x,y in A:
    if s[d]==x and y=='L':
      d-=1    
    if s[d]==x and y=='R':
      d+=1
    if d>=S:
      return False
    elif d<0:
      d+=1
  return True

ok,ng=-1,S
mid=(ok+ng)//2
while abs(ok-ng)>1:
  mid=(ok+ng)//2
  if R(mid):
    ok=mid
  else:
    ng=mid
q=ok

print(q-p+1)
import string as st
string=[]
while True:
    s = input()
    string =list(string)
    if s == '':
        break
    string.append(s)
    string=','.join(string)
    string = string.lower()
for i in range(len(st.ascii_lowercase)):
    print("{} : {}".format(st.ascii_lowercase[i],string.count(st.ascii_lowercase[i])))


### FIXED CODE ###

import string as st
string=[]
try:
    while True:
        s = input()#入力
        string =list(string)#list変換
        if not s :#空入力のときループぬける
            break
        string.extend(s)#list追加
        string=map(str,string)
        string="".join(string).lower()#str型変換と小文字
except EOFError:
    for i in range(len(st.ascii_lowercase)):
        print("{} : {}".format(st.ascii_lowercase[i],string.count(st.ascii_lowercase[i])))
import sys

sys.setrecursionlimit(10 ** 5 + 10)

MOD = 10 ** 9 + 7
inv = [None, 1]
for i in range(2, 10 ** 5 + 1):
    inv.append(MOD - MOD // i * inv[MOD % i] % MOD)

fact = [1]
ifact = [1]
for i in range(1, 10 ** 5 + 1):
    fact.append((i * fact[-1]) % MOD)
    ifact.append((inv[i] * ifact[-1]) % MOD)


class Node:
    def __init__(self, ind):
        self.ind = ind
        self.val = 1
        self.ndesc = 1
        self.neighs = []


N = int(input())
nodes = [Node(i) for i in range(N)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    nodes[a - 1].neighs.append(nodes[b - 1])
    nodes[b - 1].neighs.append(nodes[a - 1])

stack = [(-1, nodes[0])]
for i in range(N):
    fro, node = stack[i]
    for neigh in node.neighs:
        if neigh.ind == fro:
            continue
        stack.append((node.ind, neigh))

for i in range(N - 1, -1, -1):
    fro, node = stack[i]
    node.val = node.val * fact[node.ndesc - 1] % MOD
    if fro == -1:
        continue
    nodes[fro].ndesc += node.ndesc
    nodes[fro].val = nodes[fro].val * node.val * ifact[node.ndesc] % MOD

stack = [(-1, node, nodes[0].val * inv[N] % MOD)]
for i in range(N):
    fro, node, val = stack[i]
    node.val = val * node.ndesc * inv[max(1, N - node.ndesc)] % MOD
    for neigh in node.neighs:
        if neigh.ind == fro:
            continue
        stack.append((node.ind, neigh, node.val))

for i in range(N):
    print(nodes[i].val)


### FIXED CODE ###

MOD = 10 ** 9 + 7
inv = [None, 1]
for i in range(2, 10 ** 5 * 2 + 1):
    inv.append(MOD - MOD // i * inv[MOD % i] % MOD)

fact = [1]
ifact = [1]
for i in range(1, 10 ** 5 * 2 + 1):
    fact.append((i * fact[-1]) % MOD)
    ifact.append((inv[i] * ifact[-1]) % MOD)


class Node:
    def __init__(self, ind):
        self.ind = ind
        self.val = 1
        self.ndesc = 1
        self.neighs = []


N = int(input())
nodes = [Node(i) for i in range(N)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    nodes[a - 1].neighs.append(nodes[b - 1])
    nodes[b - 1].neighs.append(nodes[a - 1])

stack = [(-1, nodes[0])]
for i in range(N):
    fro, node = stack[i]
    for neigh in node.neighs:
        if neigh.ind == fro:
            continue
        stack.append((node.ind, neigh))

for i in range(N - 1, -1, -1):
    fro, node = stack[i]
    node.val = node.val * fact[node.ndesc - 1] % MOD
    if fro == -1:
        continue
    nodes[fro].ndesc += node.ndesc
    nodes[fro].val = nodes[fro].val * node.val * ifact[node.ndesc] % MOD

stack = [(-1, node, nodes[0].val * inv[N] % MOD)]
for i in range(N):
    fro, node, val = stack[i]
    node.val = val * node.ndesc * inv[max(1, N - node.ndesc)] % MOD
    for neigh in node.neighs:
        if neigh.ind == fro:
            continue
        stack.append((node.ind, neigh, node.val))

for i in range(N):
    print(nodes[i].val)
a,b = input().split()
#a,b = int(a),int(b)
print(max(a-2*b,0))

### FIXED CODE ###

a,b = input().split()
a,b = int(a),int(b)
print(max(a-2*b,0))
S = list(input())
a = list.count('+')
b = list.count('-')
print(int(a) - int(b))


### FIXED CODE ###

S = list(input())
a = S.count('+')
b = S.count('-')
print(int(a) - int(b))
S=input()

cc=0
nc=0
for i in range(2,len(S)-1):
    if S[i]=='C':
        cc+=1
        nc=i

if cc==1:
    p1=True

if S[0]=='A':
    p2=True

bc=0
for i in range(len(S)):
    if i==0 or i==nc:
        pass
    else:
        if S[i].islower()==False:
            bc+=1

if p1==True and p2==True and bc==0:
    print('AC')

else:
    print('WA')


### FIXED CODE ###

S=input()

cc=0
nc=0
for i in range(2,len(S)-1):
    if S[i]=='C' and S[i].islower()==False:
        cc+=1
        nc=i

if cc==1 and not nc==0:
    p1=True
else:
    p1=False

if S[0]=='A' and S[0].islower()==False:
    p2=True
else:
    p2=False

bc=0
for i in range(len(S)):
    if i==0 or i==nc:
        pass
    else:
        if S[i].islower()==False:
            bc+=1

if p1==True and p2==True and bc==0:
    print('AC')

else:
    print('WA')
import math
a,b,c,d = map(int,input().split())
count_c = 0
count_d = 0
count_cd = 0
count = 0
j = 1
g = c*d//math.gcd(c,d)
while(1):
    if c*j <= b and c*j>=a:
        count_c += 1
    if d*j <=b and d*j >= a:
        count_c += 1
    if g*j <=b and g*j >= a:
        count_cd += 1
    if c*j > b and d*j > b and g*j > b:
        break
    j += 1
s = count_c+count_d-count_cd
print(b-a +1-s)

### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
count_c = 0
count_d = 0
count_cd = 0
count = 0
j = 1
g = c*d//fractions.gcd(c,d)

count_c = b//c - (a-1)//c
count_d = b//d - (a-1)//d
count_cd = b//g -(a-1)//g
count_s = count_c+count_d-count_cd
print(b-a+1-count_s)
import itertools


def actual(n, D):
    """
    combinations でゴリ押し
    """
    comb = itertools.combinations(D, 2)

    # return sum([x * y for x, y in comb])

    """
    「順番を考慮しない2要素の選び方」を全探索する際のポイント
        内側のループ変数の始点を外側のループ変数 +1 から始めるとよい。
        これにより、内側のループで選ぶインデックスが必ず外側のループで選ぶインデックスより大きくなり、
        同じ選び方を 2 回見てしまうことを回避できます。
    """
    # s = 0
    # for i in range(len(D)):
    #     for j in range(i + 1, len(D)):
    #         s += D[i] * D[j]
    #
    # return s

    """
    O(N)で解くパターン
    
    ex: a, b, c, d
        a*b + a*c + a*d = a * (b + c +d)
              b*c + b*d = b * (    c +d)
                    c*d = c * (       d)
    """
    s = 0
    for i in range(len(D) - 1):
        s += D[i] * sum(D[i + 1:])

    return s


n = int(input())
D = list(map(int, input().split()))

print(actual(n, D))


### FIXED CODE ###

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

if a <= b * 2:
	print(0)
else:
	print(a - b * 2)