Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l == s:
                cnt += 1

print(cnt)

Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import itertools
import numpy as np

k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = list(itertools.product(lst, repeat=3))

arr = np.array(prod)
arr_sum = arr.sum(axis=1)
ans = np.count_nonzero(arr_sum == s)

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = 0
ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]



ans = 0
ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!




ans = 0
ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!


k, s = map(int, input().split())

lst = [i for i in range(k+1)]


ans = 0
ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd


Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):

import itertools
import pandas as pd

k, s = map(int, input().split())













Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]




ans = 0
ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = 0
ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k+1)]


prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i for i in range(k)]

prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = s_bool.sum()

print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import itertools
import pandas as pd

k, s = map(int, input().split())

lst = [i+1 for i in range(k)]

prod = itertools.product(lst, repeat=3)

frame = pd.DataFrame(list(prod))

frame['ans'] = frame[0]+frame[1]+frame[2]

s_bool = (frame['ans'] ==s)

ans = s_bool.sum()
print(ans)











Fixed submission:
# coding: utf-8
# Your code here!

k, s = map(int, input().split())

cnt = 0

for i in range(k+1):
    for j in range(k+1):
        if s-i-j <= k and s-i-j>=0:
            cnt += 1

print(cnt)