Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
count = 0
 
for x in range(int(K)+1):
  for y in range(int(K)+1):
    z = int(S) - x - y
    if 0 <= z and z <= int(K):
    	count += 1
 
print(count)

Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0
 
for x in range(int(K)+1):
  for y in range(int(K)+1):
    z = int(S) - x - y
    if 0 <= z and z <= int(K):
    	count += 1

print(count)

Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count = count + 1
        
print(count)

Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
        
print(count)

Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(int(K)):
    for y in range(int(K)):
        z = int(S) - x - y
        if 0 <= z and z <= int(K):
            count += 1

print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(int(K)):
    for y in range(int(K)):
        z = int(S) - x - y
        if 0 <= z and z <= int(K):
            count += 1

print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(K):
    for y in range(K):
        z = S - x - y
        if 0 <= z and z <= K:
            count += 1

print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
count = 0

for x in range(K):
  for y in range(K):
    z = S - x - y
    if 0=< z and z =< K:
      count += 1
      
print(count)
      

Fixed submission:
K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)