peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import math

N = int(input())

for x in range(N,1,-1):
    val = int(x * 1.08)
    if val == N:
        print(x)
        exit()

print(':(')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
c = list(map(int, input().split(" ")))

b_sum = sum(b)

c_sum = 0
for i in range(n-1):
    ai = a[i]
    if ai != n:
        c_sum += c[ai-1]

print(b_sum + c_sum)
# Judge status: Wrong Answer
import math 
a,b=map(int,input().split())
print(math.ceil(b/a))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

cnt = 0

for i in range(n):
    if a[i] > b[i]:
        k = a[i] - b[i]
        b[i] += k
        cnt += k

for i in range(n):
    if a[i] < b[i]:
        k = (b[i] - a[i]) // 2
        a[i] += 2 * k
        cnt -= k
        if a[i] < b[i]:
            a[i] += 2
            b[i] += 1

print('Yes') if cnt <= 0 else print('No')
# Judge status: Accepted
n = int(input())
D = tuple(map(int, input().split()))
maxd = max(D)
mod = 998244353
cd = [0] * (maxd+1)
for d in D:
    cd[d] += 1

pre_nodes = cd[0]
if pre_nodes != 1 or D[0] != 0:
    print(0)
    exit(0)

ans = 1
for i in range(1, maxd+1):
    nodes = cd[i]
    ans *= pow(pre_nodes, nodes, mod)
    ans %= mod
    pre_nodes = nodes
else:
    print(ans)
# Judge status: Wrong Answer
l = list(map(int, input().split()))
k = int(input())

print(sum(l) + max(l)*2*k - max(l))
# Judge status: Accepted
n=int(input())
ans=0
for i in range(1,n+1):
    for j in range(i,n+1,i):
        ans+=j
print(ans)
# Judge status: Accepted
r = int(input())
print(2*3.141592*r)
# Judge status: Accepted
import math
a = int(input())
y = 100
cnt = 0
while y < a:
  y *= 1.01
  y =math.floor(y)
  cnt += 1
print(cnt)
# Judge status: Accepted
N,M=map(int,input().split())
 
if N==1:
  if M==1:
    print(1)
  else:
    print(M-2)
elif N==2:
  print(0)
else:
  if M==1:
    print(N-2)
  elif M==2:
    print(0)
  else:
    print((N-2)*(M-2))
# Judge status: Wrong Answer
n, h = list(map(int, input().split()))

wield = 0
bs = []

for i in range(n):
    a, b = list(map(int, input().split()))

    if a > wield:
        wield = a

    bs.append(b)

throw = 0
throwCnt = 0

for i in range(n):
    if bs[i] > wield:
        throw += bs[i]
        throwCnt += 1

print((h-throw+wield-1)//wield + throwCnt)
# Judge status: Accepted
import bisect
n = int(input())
a = sorted(list(map(int,input().split())))
b = sorted(list(map(int,input().split())))
c = sorted(list(map(int,input().split())))
ans = 0
for i in range(n):
  ans += bisect.bisect_left(a,b[i])*(n-bisect.bisect_right(c,b[i]))
print(ans)
# Judge status: Wrong Answer
S = {1,2,3}
A = {int(input())}
B = {int(input())}
C = S - A - B
# Judge status: Accepted
h,n=map(int,input().split())
a = list(map(int,input().split()))
print('Yes' if sum(a)>=h else 'No')
# Judge status: Accepted
import math
 
k = int(input())
 
cache = {}
ans = 0
for a in range(1, k+1):
    for b in range(1, k+1):
        for c in range(1, k+1):
            ans = ans + cache.get( (a,b,c), math.gcd(math.gcd(a, b), c))
print(ans)
# Judge status: Accepted
N = int(input())

time = 0
visited = [0, 0]
result = []

for i in range(N):
    t, *xy = map(int, input().split())
    diff_time = t - time
    diff_dist = sum([abs(xy[i] - visited[i]) for i in range(2)])
    if (diff_dist <= diff_time) & (((diff_time - diff_dist) % 2)==0):
        result.append(True)
    else:
        result.append(False)
    time = t
    visited = xy

print("Yes") if all(result) else print("No")
# Judge status: Accepted
import collections
N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
def main():
    if c[0] >0:
        print(0)
        return

    ans = 1
    for a in A:
        ans *= a
        if ans > 1e18:
            ans = -1
            break
    if ans > 1e18:
        ans = -1
    print(ans)
main()
# Judge status: Accepted
N, M, K = map(int, input().split()) 

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

a,b = [0], [0]

for i in range(N):
    a.append(a[i] + A[i])

for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M

for i in range(N+1):
    if a[i] > K:
        break

    while b[j]  > K - a[i]:
        j -= 1
    ans = max(ans, i+j)

print(ans)
# Judge status: Accepted
A,B = map(int,input().split()) 
if (A+B)%2==1:
    print('IMPOSSIBLE')
elif (A+B)%2==0:
    print((A+B)//2)
# Judge status: Accepted
s,w=map(int,input().split())
if s<=w:
  print('unsafe')
else:
  print('safe')
# Judge status: Accepted
import math

n, k = map(int, input().split())
l = list(map(int, input().split()))

if n == k:
    print(1)
elif k == 2:
    print(n-1)
else:
    print(math.ceil((n-k)/(k-1))+1)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt=sum(b)-sum(a)
for i,j in zip(a,b):
  if i<j:cnt-=(j-i+1)//2
print(['No','Yes'][cnt>=0])
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 10**9
for i in range(a[0],a[len(a)-1]+1):
    temp = sum([(abs(j-i))**2 for j in a])
    ans = min(ans,temp)
print(ans)
# Judge status: Wrong Answer
c = [list(map(int,input().split())) for _ in range(3)]

s = [sum(c[i]) for i in range(3)]
S = sum(s)

if S % 3 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# C
N = int(input())
P = list(map(int,input().split()))
min_p = 10**10
ans = 0
for i in range(N):
  if min_p >= P[i]:
    ans += 1
  min_p = min(min_p,P[i])
print(ans)
# Judge status: Accepted
import math
n,p=map(int,input().split())
c=0
for m in map(int,input().split()):
  if m%2==0:c+=1
d=2**(c)

e=0
for i in range(p,n-c+1,2):
  
  k=math.factorial(n-c) // (math.factorial(n-c - i) * math.factorial(i))
  k=max(k,1)
  e+=k

print(d*e)
# Judge status: Accepted
import sys

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

a.sort()

number = {}

for item in a:
    if item in number.keys():
        number[item] += 1
    else:
        number[item] = 1
    
cnt = 0
for i in number.values():
    if i % 2 != 0:
        cnt += 1

print("{}".format(cnt))
# Judge status: Accepted
a=input()
w=["SUN","MON","TUE","WED","THU","FRI","SAT"]
l=[7,6,5,4,3,2,1]
print(l[w.index(a)])
# Judge status: Accepted
n=int(input())
ans=0
for a in range(1,n+1):
    for b in range(1,n+1):
        if n<=a*b:
            break
        ans+=1
print(ans)
# Judge status: Accepted
n = int(input())
p = n // 15
print(n * 800 - 200 * p)
# Judge status: Accepted
def out(c, n):
    for i in range(n):
        print(c, end='')

sx, sy, tx, ty = map(int, input().split())

out('U', ty - sy)
out('R', tx - sx)
out('D', ty - sy)
out('L', tx - sx)

out('L', 1)
out('U', ty - sy + 1)
out('R', tx - sx + 1)
out('D', 1)
out('R', 1)
out('D', ty - sy + 1)
out('L', tx - sx + 1)
out('U', 1)

print()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 0
m = a[0]
for i in range(1,n):
  if a[i] <= m:
    ans += -a[i]+m
  else:
    m = a[i]
print(ans)
# Judge status: Accepted
N=int(input())
*A,=map(int,input().split())
s=list(map(lambda x: x//400, A))

mm=len(set([i for i in s if i<8])) 
o=len([i for i in s if 8<=i]) # 色を変えられる人
print(mm if 1<=mm else 1,min(N,mm+o))
# Judge status: Accepted
import string
lower = string.ascii_lowercase

n = int(input())

# if n == 1:
#     print('a')
#     exit()

ans = ['']

for i in range(n):
    new_list = []
    for word in ans:
        for new_char in lower:
            if new_char in word:
                new_list.append(word + new_char)
            else:
                new_list.append(word + new_char)
                break
    ans = new_list
#    print(new_list)

for word in ans:
    print(word)
# Judge status: Wrong Answer
n=int(input())
s=input()
t=sorted(s)
t.append("X")
cnt=1
ans=1
for i in range(n):
    if t[i]==t[i+1]:
        cnt+=1
    else:
        ans*=(cnt+1)
        cnt=1
print(ans-1)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def f(a, b, c):
    if (a%2 != 0) | (b%2 != 0) | (c%2 != 0):
        return 0
    if (a == b) & (b == c):
        return -1
    return f((b+c)//2, (a+c)//2, (a+b)//2) + 1
def main():
    a, b, c = map(int, readline().split())
    print(f(a, b, c))
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
S = input()

if S.count('A') or S.count('B') == 3:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
s = input()
partition = s.replace('><','>|<').split('|')
ans=0

for sub in partition:
    left = sub.count('<')
    right = sub.count('>')
    ans += sum(range(1, max(left, right) + 1))
    ans += sum(range(1, min(left, right)))

print(ans)
# Judge status: Accepted
MOD = 10**9 + 7

n,m = map(int,input().split())

ban = [False] * (n + 1)

for i in range(m):
    a = int(input())
    ban[a] = True

dp = [0] * (n + 1)
dp[0] = 1

for i in range(n):
    dp[i] %= MOD
    if ban[i]:dp[i] = 0
    #print(i, dp[i])
    if i + 1 <= n:
        dp[i + 1] += dp[i]
    if i + 2 <= n:
        dp[i + 2] += dp[i]

print(dp[n] % MOD)
# Judge status: Accepted
S = list(input())
if len(set(S))==3:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n, d = map(int, input().split())

cnt = 0
dist = ()
for i in range(n):
    x, y = map(float, input().split())
    dist = (x ** 2) + (y ** 2)
    if dist <= d ** 2:
        cnt += 1

print(cnt)
# Judge status: Wrong Answer
S = list(input())

last = S.pop(0)
stack = [last]
can_pop = True
cnt = 0
for s in S:
    if last != s and can_pop:
        stack.pop()
        can_pop = False
        # stack.append(s) 読み捨て
        cnt += 2
    else:
        stack.append(s)
        last = s
        can_pop = True

print(cnt)
# Judge status: Accepted
import math
a, b = map(int, input().split())
print(math.ceil((b-1)/(a-1)))
# Judge status: Wrong Answer
a = list(map(int, input().split()))
a.sort()
print(a[0]*a[1]/2)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

four = 0
two = 0
one = 0
for i in a:
  if i%4 == 0:
    four += 1
  elif i%2 == 0 and i%4 != 0:
    two += 1
  elif i%2 != 0:
    one += 1

if four >= one or four + 1 >= two//2 + two%2 + one or n == two:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
import numpy as np
import math
import collections
import copy
from collections import deque 
from functools import reduce
from itertools import product

# input = sys.stdin.readline

N = int(input())
n_np = np.zeros(105**3)
for i in range(1, 105):
    for j in range(1, 105):
        for k in range(1, 105):
            idx = i**2 + j**2 + k **2 + i*j + i*k + j*k
            n_np[idx-1] += 1
for i in range(N):
    print(int(n_np[i]))
# Judge status: Wrong Answer
s= sorted(input())
t= sorted(input(), reverse=True)

for i, j in zip(s, t):
  if i < j:
    print("Yes")
    break
else:
  if len(s) < len(t):
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
v=['a','i','u','e','o'];print('vowel' if 0!=v.count(input) else 'consonant')
# Judge status: Wrong Answer
a=int(input())

s=[input() for i in range(a)]

print("AC × {:d}".format(s.count("AC")))
print("WA × {:d}".format(s.count("WA")))
print("TLE × {:d}".format(s.count("TLE")))
print("RE × {:d}".format(s.count("RE")))
# Judge status: Wrong Answer
N = int(input())
T, A = map(int, (input().split(" ")))
H = list(map(int,input().split(" ")))
ans_t = 10000
ans = 0
 
for i in range(N):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    ans = i + 1
print(ans)
# Judge status: Wrong Answer
s = input()

chkStr = ["k","e","y","e","n","c","e"]

inpStr = list(s)
idx = 0

chkCount = 0


# print(chkStr)
# print(inpStr)
bParam = 0
stopParam = 0

for i in range(len(inpStr)):
    if chkStr[idx] == inpStr[i]:
        idx += 1
        chkCount += 1
    elif bParam == 0 or bParam != idx:
        bParam = idx
        stopParam += 1


    
    if idx == len(chkStr):
        break


if chkCount == len(chkStr) and stopParam <= 1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
import sys

S = sys.stdin.readline().strip()
K = int(sys.stdin.readline())

for s_i in S:
    if s_i == "1":
        K -= 1
    else:
        break
print(s_i)
# Judge status: Wrong Answer
import collections
n,m = map(int, raw_input().split(' '))
forbidden = set([int(raw_input()) for _ in range(m)])
q = collections.deque([1])
mod = (10 ** 9) + 7
w = 1
while(w <n):
	q.append((1 if w not in forbidden else 0) * (sum(q) % mod))
	w += 1
	if len(q) == 3: q.popleft() 
print q[-1]
# Judge status: Accepted
a,b=map(int,input().split())
print(a if b >= a else a-1)
# Judge status: Accepted
# coding: utf-8
# Your code here!
from collections import deque
k=int(input())
ans=[]
d=deque([1,2,3,4,5,6,7,8,9])
c=0
while c<11:
    q=d.popleft()
    ans.append(q)
    c=len(str(q))
    b=q%10
    if b!=0:
        d.append(q*10+b-1)
    d.append(q*10+b)
    if b!=9:
        d.append(q*10+b+1)
    
print(ans[k-1])
# Judge status: Accepted
import sys
N = int(input())

for i in range(26):
    for j in range(15):
        if (4 * i + 7 * j) == N:
            print('Yes')
            sys.exit()
print('No')
# Judge status: Accepted
# A
l = list(map(int, input().split()))

if l.count(5) == 2 and l.count(7) == 1:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
a = input()
b = int(input())
cnt = b
for i in a:
  if cnt == 0:
    print("1")
    break
  else:
    if i =="1":
      cnt -= 1
    else:
      print(i)
      break
# Judge status: Wrong Answer
X = int(input())
if X>=499 and X<=599:
  print("8")
elif X>=600 and X<=799:
  print("7")
elif X>=800 and X<=999:
  print("6")
elif X>=1000 and X<=1199:
  print("5")
elif X>=1200 and X<=1399:
  print("4")
elif X>=1400 and X<=1599:
  print("3")
elif X>=1600 and X<=1799:
  print("2")
elif X>=1800 and X<=1999:
  print("1")
# Judge status: Accepted
from bisect import bisect_right
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
accu = 0
aa = [0]
for i in a:
    accu += i
    aa.append(accu)
accu = 0
bb = [0]
for i in b:
    accu += i
    bb.append(accu)
ans = 0
for i in range(n+1):
    if aa[i]>k:
        break
    tmp = i+bisect_right(bb, k-aa[i])-1
    ans = max(tmp, ans)
print(ans)
# Judge status: Accepted
station = input()
print("Yes" if "AB" in station or "BA" in station else "No")
# Judge status: Accepted
a = input()
b = input()

ans = 0
for i,aa in enumerate(a):
    if b[i] != aa:
        ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
flag = True
for i in A:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            pass
        else:
            flag = False
            break

if flag == True:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int,input().split())

xd = tx - sx
yd = ty - sy

route1 = []
route1.append('R'*xd)
route1.append('U'*yd)

route2 = []
route2.append('L'*xd)
route2.append('D'*yd)

route3 = ['D']
route3.append('R' * (xd + 1))
route3.append('U' * (yd + 1))
route3.append('L')

route4 = ['U']
route4.append('L'*(xd+1))
route4.append('D'*(yd+1))
route4.append('R')

ans = ''.join(route1) + ''.join(route2) + ''.join(route2) + ''.join(route4)
print(ans)
# Judge status: Accepted
import sys
rline = sys.stdin.readline

N = int(input())


def dfs(ans, max_c):
    if len(ans) == N:
        print(ans)
    else:
        for i in range(max_c + 1):
            dfs(ans + chr(ord('a') + i), max_c + 1 if i == max_c else max_c)


def solve():
    dfs('', 0)


if __name__ == '__main__':
    solve()
# Judge status: Accepted

N = int(input())

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

ans = ""

while N != 0:
  bit = N % -2
  if (bit < 0):
    bit += 2
  ans = str(bit) + ans
  N = (N - bit) // (-2)

print(ans)
# Judge status: Wrong Answer
n, x = map(int,input().split())
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if i + l[i] <= x:
        cnt +=1
print(cnt)
# Judge status: Wrong Answer
A,B = map(int,input().split())
seki = A*B

if B>A:
    C = A
    A = B
    B = C

while A%B != 0:
    a = A
    b = B
    A = a//b
    B = a%b
    
print(int(seki/B))
# Judge status: Accepted
N = [int(c) for c in input()]
dp = 0,1
for i in range(len(N)):
  a = min(dp[0]+N[i], dp[1]+10-N[i])
  b = min(dp[0]+N[i]+1, dp[1]+10-N[i]-1)
  dp = a,b
print(dp[0])
# Judge status: Accepted
n = int(input())

if n == 0:
    print(0)
    exit()

ans = ''
while True:
    ans += str(n % 2)
    if(n < 0):
        n = (abs(n) + 1) // 2
    else:
        n = -1 * (n // 2)

    if(n == 1):
        ans += '1'
        break

print(ans[::-1])
# Judge status: Wrong Answer
N = int(input())
li = []
for i in range(1,100):
    for j in range(2,50):
        if i**j<=1000:
            li.append(i**j)
li.sort()
ans = 1
for k in range(len(li)):
    if (li[k-1]<=N)&(li[k]>N):
        ans = li[k-1]
print(ans)
# Judge status: Wrong Answer
from collections import deque

n,m,k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A,B = deque(A),deque(B)
count = 0
a = A.popleft()
b = B.popleft()
while k>=a or k>=b:
    if a<b:
        k -= a
        count+=1
        if A: a = A.popleft()
        else: a = 10**10
    else:
        k -= b
        count+=1
        if B: b = B.popleft()
        else: b = 10**10
print(count)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

y = sum(a)
x = 0
ans = 10000000000000000

for i in range(0, N - 1):
    x += a[i]
    y -= a[i]
    ans = min(ans, abs(x - y))

print(ans)
# Judge status: Accepted
import collections
import itertools

N=int(input())
S=[input() for i in range(N)]

counted = collections.Counter(S)

# 最頻値を求める
m = max(counted.values())

# 頻出数の文字を集める
chars = [key for key, value in counted.items()
             if value == m]
chars=sorted(chars)
for a in chars:
  print(a)
# Judge status: Accepted
a,b,c,d = input()
if a == b or b==c or c == d:
    print('Bad')
else:
    print('Good')
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

from collections import Counter

Num=Counter(A)

S=0
for i in Num.values():
    S+=i*(i-1)//2

for k in range(N):
    n=Num[A[k]]
    ans=S-n*(n-1)//2+(n-1)*(n-2)//2
    print(ans)
# Judge status: Accepted
def main():
    a, b, t = map(int, input().split())

    print((int(t+0.5)//a * b))
    
if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c = map(int, input().split())
if a<=c:
    if b<=c-a:
        print('0 0')
    else:
        print('0 {}'.format(a+b-c))
else:
    print('{} {}'.format(a-c,b))
# Judge status: Wrong Answer
def main():
  n=list(input())
  n=[int(i) for i in reversed(n)]
  l=len(n)
  n.append(0)
  
  ans=0
  for i in range(l):
    if n[i]<=5:
      a=n[i]
    else:
      n[i+1]+=1
      a=10-n[i]
    ans+=a
  ans+=n[l]
  print(ans)  
if __name__=='__main__':
    main()
# Judge status: Accepted
n = int(input())
li = list(map(int,input().split()))
cnt = 0
new_li = []
for l in li:
    if l<0:
        cnt += 1
    new_li.append(abs(l))
if cnt%2 == 0:
    print(sum(new_li))
else:
    print(sum(new_li)-(2*(min(new_li))))
# Judge status: Accepted
X=int(input())
n=X%100
m=X//100
if 0<=n<=m*5:
  print(1)
else:
  print(0)
# Judge status: Accepted
import sys
import itertools


input = sys.stdin.readline


def main():
    a, b = -1, -1
    count = 0
    for p in itertools.permutations(range(1, N+1)):
        if p == P:
            a = count
        if p == Q:
            b = count
        if a != -1 and b != -1:
            break
        count += 1
    print(abs(a-b))


if __name__ == "__main__":
    N = int(input())
    P = tuple([int(p) for p in input().split()])
    Q = tuple([int(q) for q in input().split()])
    main()
# Judge status: Accepted
from itertools import combinations_with_replacement as combi

N, M, Q = map(int, input().split())
a = [0] * Q
b = [0] * Q
c = [0] * Q
d = [0] * Q
l = [i+1 for i in range(M)]
point = 0

for i in range(Q):
    a[i], b[i], c[i], d[i] = map(int, input().split())

for v in combi(l, N):
    tmp = 0
    for j in range(Q):
        if v[b[j]-1] - v[a[j]-1] == c[j]:
            tmp += d[j]
    point = max(point, tmp)

print(point)
# Judge status: Wrong Answer
S=set(int(input())for i in range(2))
print({1,2,3}-S)
# Judge status: Accepted
N,*A=map(int,open(0).read().split())

colors = [0 for i in range(8)]
tyty = 0

for a in A:
  c = a//400
  if c>=8:
    tyty+=1
  else:
    colors[c]+=1

cNum = 8-colors.count(0)
    
minC = max(cNum,1)
maxC = cNum+tyty

print(minC,maxC)
# Judge status: Accepted
*l,k=map(int,open(0).read().split())
from itertools import permutations 
perm = permutations(l, 2) 
ans=[]
for i in list(perm): 
  ans.append(i[1]-i[0])
print("Yay!" if max(ans)<= k else ":(")
# Judge status: Accepted
k, s = map(int, input().split(' '))
ans = 0
for x in range(k+1):
    for y in range(k+1):
        if s - k <= x + y <= s:
            ans +=1
print(ans)
# Judge status: Accepted
import math

def main():
    n = int(input())
    a = [int(t) for t in input().split()]

    m = 0
    if 0 in a or len([x for x in a if x<0])%2==0:
        m = sum([abs(x) for x in a])
    else:
        a_ = [abs(x) for x in a]
        m = sum(a_)-2*min(a_)

    print(m)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a = input()
if a == 0:
  a = 1
  print(a)
else:
  a = 0
  print(a)
# Judge status: Accepted
n, m = map(int,input().split())
if n > m:
    n, m = m, n
if n == 1 and m == 1:
    print(1)
elif n == 1:
    print(m-2)
elif n == 2:
    print(0)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
def main():
  n=int(input())
  p = list(map(int,input().split()))
  ans=0
  for i in range(0,n-2):
    if max(p[i:i+3])!=p[i+1] and min(p[i:i+3])!=p[i+1]:
      ans+=1
  print(ans)
main()
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
H = map(int, input().split())

near_i = -1
min_diff = 10**6 * 0.006
for i, h in enumerate(H):
    temp = T - h * 0.006
    diff = abs(A - temp)
    if diff < min_diff:
        min_diff = diff
        near_i = i
print(near_i+1)
# Judge status: Wrong Answer
n = input()
if len(set(n)) >= 3:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
l = input().split()
l.sort(reverse=True)
print(int(l[0]+l[1])+int(l[2]))
# Judge status: Wrong Answer
N,M,X=map(int, input().split())
A=list(list(map(int, input().split())) for _ in range(N))
ans=M*10**5+1
import itertools
import numpy as np
for i in range(1,M+1):
    for aa in list(itertools.combinations(A,i)):
        tmp=np.array([0]*len(A[0]))
        for a in aa:
            a = np.array(a)
            tmp=tmp+a
        if min(tmp[1:])>=X:
            ans=min(ans,tmp[0])       
print(ans if ans!=(M*10**5+1) else -1)
# Judge status: Accepted
n = int(input())
d = sorted(list(map(int, input().split())))
if d[n//2-1] == d[n//2]:
    print(0)
else:
    print(d[n//2] - d[n//2-1])
# Judge status: Wrong Answer
import collections as c

n,k = map(int,input().split())
l = list(map(int,input().split()))
count = c.Counter(l)
ans = 0
check = 0
right = len(count)-k
if right == 0:
    print(0)
    exit()
for i,j in count.most_common()[::-1]:
    ans += j
    check += 1
    if check == right:
        print(ans)
        exit()
# Judge status: Accepted
#043_A
n=int(input())
print(n*(n+1)//2)
# Judge status: Accepted
# This Python file uses the following encoding: utf-8

# if __name__ == "__main__":
#     pass
a, b, c, d = map(int, input().split())
'''
while a > 0 and c > 0:
    c -= b
    a -= d
if c <= 0:
    print("Yes")
else:
    print("No")
'''
if  -(-c//b) <= -(-a//d):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

S = list(readline().rstrip())
K = int(readline())
N = len(S)
for i in range(N):
    t = ord(S[i])-97
    if 26 - t <= K:
        S[i] = 'a'
        K -= 26-t
S[-1] = chr((ord(S[-1])-97 + K%26)%26 + 97)
print(''.join(S))
# Judge status: Accepted
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
A,B=map(int,input().split())
print(lcm(A,B))
# Judge status: Accepted
l,r,d = map(int,input().split())
ans = 0
for i in range(l,r+1):
    if i % d == 0:
        ans += 1
print(ans)