Buggy python submission (verdict: Runtime Error):
    s = input()
    print(s.replace(',', ' '))

Fixed submission:
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        for j in range(A):
            if  S - (i + j) <= K :
                if 0 <= S - (i + j): 
                    cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        x = i
        for j in range(A):
            y = j
            for k2 in range(A) :
                z = k2
                if x + y + z == S:
                    cnt += 1

print(cnt)


Fixed submission:
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        for j in range(A):
            if  S - (i + j) <= K :
                if 0 <= S - (i + j): 
                    cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        x = i
        if x + y + z == S :
            cnt += 1
        for j in range(A):
            y = j
            if x + y + z == S :
                cnt += 1
            for k2 in range(A) :
                z = k2
                if x + y + z == S:
                    cnt += 1

print(cnt)


Fixed submission:
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        for j in range(A):
            if  S - (i + j) <= K :
                if 0 <= S - (i + j): 
                    cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
if K * 3 == S:
    cnt = 1
else :
    for i in range(K + 1):
        x = i
        if x + y + z == S :
            cnt += 1
        for j in range(K + 1):
            y = j
            if x + y + z == S :
                cnt += 1
            for k2 in range(K + 1) :
                z = k2
                if x + y + z == S:
                    cnt += 1

print(cnt)


Fixed submission:
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        for j in range(A):
            if  S - (i + j) <= K :
                if 0 <= S - (i + j): 
                    cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
K , S = map(int, input().split())
x = 0
y = 0
z = 0
sum = 0
cnt = 0
if K * 3 == S:
    cnt = 1
else :
    for i in range(K + 1):
        x = i
        if x + y + z == S :
    #        print(str(x) + str(y) + str(z))
            cnt += 1
        for j in range(K + 1):
            y = j
            if x + y + z == S :
    #            print(str(x) + str(y) + str(z))
                cnt += 1
            for k2 in range(K + 1) :
                z = k2
                if x + y + z == S:
    #                print(str(x) + str(y) + str(z))
                    cnt += 1

print(cnt)


Fixed submission:
K , S = map(int, input().split())
x , y , z , cnt = 0 , 0 , 0 , 0
A = K + 1
if K * 3 == S:
    cnt = 1
else :
    for i in range(A):
        for j in range(A):
            if  S - (i + j) <= K :
                if 0 <= S - (i + j): 
                    cnt += 1
print(cnt)