qyliang/CodeNanoFix huggingface dataset:
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for a in range(A):
    for b in range(B):
        for c in range(C):
            s = a * 500 + b * 100 + c * 50
            if s == X:
                count += 1

print(count)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            s = a * 500 + b * 100 + c * 50
            # print(a, b, c, s)
            if s == X:
                count += 1

print(count)
Buggy code:
a,b,c,x = [int(input()) for i in range(4)]
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == 500*a + 100*b + 50*c:
                ans += 1
print(ans)

Fixed code:
a,b,c,x = [int(input()) for i in range(4)]
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == 500*i + 100*j + 50*k:
                ans += 1
print(ans)
Buggy code:
n_500 = int(input())
n_100 = int(input())
n_50 = int(input())
price = int(input())
count = 0

for i in range(n_500+1):
    for j in range(n_100+1):
        for k in range(n_50+1):
            if(price ==500*i+100*j+50*k):
                count+=1S

print(count)

Fixed code:
n_500 = int(input())
n_100 = int(input())
n_50 = int(input())
price = int(input())
count = 0

for i in range(n_500+1):
    for j in range(n_100+1):
        for k in range(n_50+1):
            if(price ==500*i+100*j+50*k):
                count+=1

print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

output = 0
for a in range(A):
  for b in range(B):
    for c in range(C):
      total = 500*a + 100*b + 50*c
      if total == X:
        output += 1

print(output)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

output = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      total = 500*a + 100*b + 50*c
      if total == X:
        output += 1

print(output)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
if a != 0 and a != 50:
    a = a+1
if b != 0 and b != 50:
    b = b+1
if c != 0 and c != 50:
    c = c+1
for i_a in range(a):
    for j_b in range(b):
        for k_c in range(c):
            if(i_a * 500 + j_b * 100 + k_c * 50 == x):
                count = count + 1
if a == b == c == 0:
    count = count + 1
print(count)


Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i_a in range(a+1):
    for j_b in range(b+1):
        for k_c in range(c+1):
            if(i_a * 500 + j_b * 100 + k_c * 50 == x):
                count = count + 1
if a == b == c == 0:
    count = count + 1
print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

answer = 0
for i in range(A):
  for j in range(B):
    for k in range(C):
      total = 500 * i + 100 * j + 50 * k
      if total == X:
        answer += 1
print(str(answer))


Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

answer = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      total = 500 * i + 100 * j + 50 * k
      if total == X:
        answer += 1
print(str(answer))
Buggy code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(1,l[2]+1):
    b = 50 * i 
    if b == l[3]:
        a +=1
    for j in range(1,l[1]+1):
        b += 100 * j
        if b == l[3]:
            a += 1
        for k in range(1,l[2]+1):
            b += 500 * k 
            if b == l[3]:
                a += 1
for j in range(1,l[1]+1):
    b = 100 * j
    if b == l[3]:
        a += 1
    for k in range(1,l[2]+1):
        b += 500 * k 
        if b == l[3]:
            a += 1
for k in range(1,l[2]+1):
    b = 500 * k 
    if b == l[3]:
        a += 1
                
print('{}'.format(a))


Fixed code:
l = [int(input()) for i in range(4)]
a = 0
for i in range(l[2]+1):
    for j in range(l[1]+1):
        for k in range(l[0]+1):
            b = 50 * i + 100 * j 
            b += 500 * k 
            if b == l[3] :
                a += 1
                 
print('{}'.format(a))
Buggy code:
A = int(input())
B = int(input())
C = int(input())
N = int(input())

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a * 500 + b * 100 + c * 50 == N:
        ans += 1

print(ans)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
N = int(input())
ans = 0
 
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a * 500 + b * 100 + c * 50 == N:
        ans += 1
 
print(ans)
Buggy code:
x=int(input())
c=0
y,z,d=int(input()),int(input()),int(input())
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            f=500*i+100*j+50*k
            if(f==x):
                c+=1
print(c)

Fixed code:
x=int(input())
c=0
y,z,d=int(input()),int(input()),int(input())
for i in range(x+1):
    for j in range(y+1):
        for k in range(z+1):
            f=500*i+100*j+50*k
            if(f==d):
                c+=1
print(c)
Buggy code:
A=[]
for _ in range(3):
    A.append(int(input()))
a=A[0]
b=A[1]
c=A[2]
x=int(input())
count=0
for p in range(a):
    for q in range(b):
        for r in range(c):
            if 500*p+100*q+50*r==x:
                count=count+1
else:
    count=count
print(count)

Fixed code:
A=[]
for _ in range(3):
    A.append(int(input()))
a=A[0]
b=A[1]
c=A[2]
x=int(input())
count=0
for p in range(a+1):
    for q in range(b+1):
        for r in range(c+1):
            if 500*p+100*q+50*r==x:
                count=count+1
            else:
              count=count
print(count)
Buggy code:
coins = []
for i in range(0, 4):
  coins.append(int(input()))

count = 0

for i in range(1, coins[0] + 1):
  for j in range(1, coins[1] + 1):
    for k in range(1, coins[2] + 1):
      ans = 500*i + 100*j + 50*k
      if ans == coins[3]:
        count += 1
print(count)




Fixed code:
coins = []
for i in range(0, 4):
  coins.append(int(input()))

count = 0

for i in range(0, coins[0] + 1):
  for j in range(0, coins[1] + 1):
    for k in range(0, coins[2] + 1):
      ans = 500*i + 100*j + 50*k
      if ans == coins[3]:
        count += 1
print(count)
Buggy code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
total = int(input())

def coin_check(coin_total, total):
    if coin_total==total:
        return 1
    else:
        return 0

count = 0
for i in range(coin_500 + 1):
    coin_total = i*500
    count+=coin_check(coin_total, total)
    for j in range(coin_100 + 1):
        coin_total = i*500 + j*100
        count+=coin_check(coin_total, total)
        for k in range(coin_50 + 1):
            coin_total = i*500 + j*100 + k*50
            count+=coin_check(coin_total, total)
print(count)

Fixed code:
coin_500 = int(input())
coin_100 = int(input())
coin_50 = int(input())
total = int(input())

def coin_check(coin_total, total):
    if coin_total==total:
        return 1
    else:
        return 0

count = 0
for i in range(coin_500 + 1):
    for j in range(coin_100 + 1):
        for k in range(coin_50 + 1):
            coin_total = i*500 + j*100 + k*50
            count+=coin_check(coin_total, total)
print(count)
Buggy code:
A, B, C, X = [int(input()) for i in range(4)]

ans = 0
for i in range(0, A):
    for j in range(0, B):
        for k in range(0, C):
            if (i*500 + j*100 + k*50)==X:
                ans+=1

print(ans)

Fixed code:
A, B, C, X = [int(input()) for _ in range(4)]

ans = 0

for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        ans += 1

print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt=0
for i in range(a):
    for j in range(b):
        for k in range(c):
            if 500*i+100*j+50*k == x:
                cnt+=1

print(cnt)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)
Buggy code:
import itertools
A = int(input())
B = int(input())
C = int(input())
AL = [500*i for i in range(A)]
BL = [100*i for i in range(B)]
CL = [50*i for i in range(C)]
num = 0

for comb in itertools.product(AL,BL,CL):
  x,y,z = comb
  if x+y+z == X:
    num += 1
print(num)

Fixed code:
import itertools
A = int(input())
B = int(input())
C = int(input())
X = int(input())
AL = [500*i for i in range(A+1)]
BL = [100*i for i in range(B+1)]
CL = [50*i for i in range(C+1)]
num = 0

for comb in itertools.product(AL,BL,CL):
  x,y,z = comb
  if x + y + z == X:
    num += 1
print(num)
Buggy code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

total,out=0,0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500+b*100+c*50 == 0:
        out+=1
        
print(out)

Fixed code:
A=int(input())
B=int(input())
C=int(input())
X=int(input())

out=0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500+b*100+c*50 == X:
        out+=1
        
print(out)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0
for i in range(A):
	for j in range(B):
		for k in range(C):
			if i*500 + j*100 + k*50 == X:
				ans +=1

print(ans)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if (i * 500 + j * 100 + k * 50) == X:
                count += 1

print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cand = [(i, j, k) for i in range(50) for j in range(50) for k in range(50)]
count = 0

for c in cand:
    if 500*c[0] + 100*c[1] + 50*c[2] == X and c[0] <= A and c[1] <= B and c[2] <= C:
        count += 1
        
print(count)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cand = [(i, j, k) for i in range(A+1) for j in range(B+1) for k in range(C+1)]
count = 0

for c in cand:
    if 500*c[0] + 100*c[1] + 50*c[2] == X:
        count += 1
        
print(count)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
# print(a, b, c, x)

ans = 0
for i_a in range(a):
    for i_b in range(b):
        for i_c in range(c):
            sum = 500 * i_a + 100 * i_b + 50 * i_c
            if sum == x:
                ans += 1

print(ans)


Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
# print(a, b, c, x)

ans = 0
for i_a in range(a+1):
    for i_b in range(b+1):
        for i_c in range(c+1):
            sum = 500 * i_a + 100 * i_b + 50 * i_c
            if sum == x:
                ans += 1

print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for l in range(0, a):
    for m in range(0, b):
        for n in range(0, c):
            if(500*l+100*m+50*n == x):
                count+=1
print(count)


Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for l in range(0, a+1):
    for m in range(0, b+1):
        for n in range(0, c+1):
            if(500*l+100*m+50*n == x):
                count+=1
print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
result = 0

for a in range(A+1):
    print(a)
    for b in range(B+1):
        print(b)
        for c in range(C+1):
            print(c)
            total = (500 * a)+(100 * b) +(50 * c)
            if total == X:
                result += 1
print(result)


Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
result = 0

for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            total = (500 * a)+(100 * b) +(50 * c)
            if total == X:
                result += 1
print(result)
Buggy code:
    A = int(input())
    B = int(input())
    C = int(input())
    X = int(input())

    value = 0
    for a in range(0, A+1):
        for b in range(0, B+1):
            for c in range(0, C+1):
                if 500*a + 100*b + 50*c == X:
                    value += 1
    print(value)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

value = 0
for a in range(0, A+1):
    for b in range(0, B+1):
        for c in range(0, C+1):
            if 500*a + 100*b + 50*c == X:
                value += 1
print(value)
Buggy code:
A = int(input().strip().split())
B = int(input().strip().split())
C = int(input().strip().split())
X = int(input().strip().split())

k = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c == X:
        k += 1

print(k)


Fixed code:
A = int(input().strip())
B = int(input().strip())
C = int(input().strip())
X = int(input().strip())

k = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c == X:
        k += 1

print(k)
Buggy code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())

count=0
for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			sum = 500*i+100*j+50*k
			if(x%50==0 and sum == x):
				count+=1


Fixed code:
a=int(input())
b=int(input())
c=int(input())
x=int(input())

count=0
for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			sum = 500*i+100*j+50*k
			if(x%50==0 and sum == x):
				count+=1

print(count)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

pat = 0
for a in range(A):
	for b in range(B):
    	for c in range(C):
          if a*500+B*100+c*50 == X:
            pat += 1
print(pat)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1
            
print(ans)
Buggy code:
A,B,C,X = [int(input() for i in range(4))]
count = 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      x = 500*a + 100*b + 50*c
      if X == x:
        count += 1
 
print(count)

Fixed code:
A, B, C, X = [int(input()) for i in range(4)]
count = 0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if(X == 500 * a + 100 * b + 50 * c):
                count += 1
print(count)
Buggy code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500):
  for j in range(b100):
    for k in range(c50):
      goukei = i * 500 + j * 100 + k * 50
      if goukei > X:
        is_over = True 
        break
      elif goukei == X:
        ans += 1
    if is_over:
      break
  if is_over:
    break
print(ans)

Fixed code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500+1):
  for j in range(b100+1):
    for k in range(c50+1):
      goukei = i * 500 + j * 100 + k * 50
      if goukei == X:
        ans += 1
        break
print(ans)
Buggy code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500):
  for j in range(b100):
    for k in range(c50):
      goukei = i * 500 + j * 100 + k * 50
      if goukei == X:
        ans += 1
print(ans)

Fixed code:
a500 = int(input())
b100 = int(input())
c50 = int(input())
X = int(input())
ans = 0
goukei = 0
is_over = False
for i in range(a500+1):
  for j in range(b100+1):
    for k in range(c50+1):
      goukei = i * 500 + j * 100 + k * 50
      if goukei == X:
        ans += 1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for i in range(0, a+1):
    for j in range(0, b+1):
        for k in range(0, c+1):
            print(i,j,k)
            if i*500 + j*100 + k*50 == x:
                count += 1

print(count)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if x == i * 500 + j * 100 + k * 50:
        count += 1

print(count)
Buggy code:
# https://atcoder.jp/contests/abc087/tasks/abc087_b
a, b, c, X = [int(input()) for i in range(4)]
n = 0
for i in range(X//500+1):
    if i > a:
        pass
    else:
        Y = X - 500 * i
        for j in range(Y // 100 + 1):
            if j > b:
                pass
            else:
                Z = Y - 100 * j
                for k in range(Z // 50 + 1):
                    if k > b:
                        pass
                    elif Z - 50 * k == 0:
                        n += 1
                    else:
                        pass

print(n)


Fixed code:
# https://atcoder.jp/contests/abc087/tasks/abc087_b
a, b, c, X = [int(input()) for i in range(4)]
n = 0
for i in range(X//500+1):
    if i > a:
        pass
    else:
        Y = X - 500 * i
        for j in range(Y // 100 + 1):
            if j > b:
                pass
            else:
                Z = Y - 100 * j
                for k in range(Z // 50 + 1):
                    if k > c:
                        pass
                    elif Z - 50 * k == 0:
                        n += 1
                    else:
                        pass

print(n)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a):
    for j in range(b):
        for k in range(c):
            if 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if i * 500 + j * 100 + k * 50 == x:
                cnt += 1
print(cnt)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        C = int((x - 500 * i - 100 * j) / 50)
        if C >= 0 and C <= 50:
            cnt += 1
            
print(cnt)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a + 1):
    for j in range(b + 1):
        y = x - i * 500 - j * 100
        if y % 50 == 0 and y // 50 <= c and y >= 0:
            cnt += 1
print(cnt)
Buggy code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if i * 500 + j * 100 + k * 50 == X:
                count += 1

print(count) 2



Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            total = 500 * i + 100 * j + 50 * k
            if total == X:
                count +=1

print(count)
Buggy code:
a = int(input()) #500
b = int(input()) #100
c = int(input()) #50
x = int(input())

cnt = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            total = 500 * i + 100 * j + 50 * k
            
            if total == x:
                print("cnt!")
                cnt += 1

print(cnt)

Fixed code:
a = int(input()) #500
b = int(input()) #100
c = int(input()) #50
x = int(input())

cnt = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            total = 500 * i + 100 * j + 50 * k
            
            if total == x:
                cnt += 1

print(cnt)
Buggy code:
l = [int(input()) for i in range(4)]
#ABCX
count = 0
for i in range(l[2]+1):
    for j in range(l[1]+1):
        for k in range(l[0]+1):
            if (i*500+j*100+k*50)==l[3]:
                count += 1
print (count)    

Fixed code:
l = [int(input()) for i in range(4)]
count = 0
for i in range(l[0]+1):
    for j in range(l[1]+1):
        for k in range(l[2]+1):
            if (i*500+j*100+k*50)==l[3]:
                count += 1
print (count)
Buggy code:
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
total = int(input())

ans = 0
for i_500 in range(coin500 + 1):
    for i_100 in range(coin100 + 1):
        for i_50 in range(coin50 + 1):
            if 500 * i_500 + 100 * i_100 + 50 * i_50 = total:
                ans += 1
print(ans)


Fixed code:
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
total = int(input())

ans = 0
for i_500 in range(coin500 + 1):
    for i_100 in range(coin100 + 1):
        for i_50 in range(coin50 + 1):
            if 500 * i_500 + 100 * i_100 + 50 * i_50 == total:
                ans += 1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
temp_list = []

for i in range(a):
    for j in range(b):
        for k in range(c):
            temp = 500*i + 100*j + 50*k
            temp_list.append(temp)

ans = [n<x for n in temp_list].count(True)
print(ans)


Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
temp_list = []

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            temp = 500*i + 100*j + 50*k
            temp_list.append(temp)

ans = [n==x for n in temp_list].count(True)
print(ans)
Buggy code:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in (a+1):
    for j in (b+1):
        for k in (c+1):
            if i*500 + j*100 + k*50 == x:
                ans += 1
print(ans)

Fixed code:
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500 + j*100 + k*50 == x:
                ans += 1
print(ans)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(a):
  for j in range(b):
    for k in range(c):
      if 500*i + 100*j + 50*k == x:
        cnt+=1
print(cnt)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k == x:
                count += 1
print(count)
Buggy code:
A,B,C,X = [int(input()) for i in range(4)]
X_original = X
n = 0

for i in range(int(A)+1):
    X = X_original
    X = X - i*500
    for j in range(int(B)+1):
        X = X - j*100
        for k in range(int(C)+1):
            if X-k*50 == 0:
                n += 1

print(n)

Fixed code:
A,B,C,X = [int(input()) for i in range(4)]
X_original = X
n = 0

for i in range(int(A)+1):
    X = X_original
    X500 = X - i*500
    for j in range(int(B)+1):
        X100 = X500 - j*100
        for k in range(int(C)+1):
            X50 = X100-k*50
            if X50== 0:
                n += 1

print(n)
Buggy code:
total=0
count=0

for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            total=500*l + 100*m + 50*n
            print(total)
            if(total==X): count += 1
                
print(count)

Fixed code:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

total=0
count=0

for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            total=500*l + 100*m + 50*n
            if(total==X): count += 1
                
print(count)
Buggy code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0

for i in range(a):
  for j in range(b):
    for k in range(c):
      sum = i*500 + j*100 + k*50
      if sum == x:
        cnt += 1

print(cnt)

Fixed code:
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      sum = i*500 + j*100 + k*50
      if sum == x:
        cnt += 1

print(cnt)
Buggy code:
def tyoudo(a,b,c,x):
  ans=0
  for i in range(a):
    for ii in range(b):
      for iii in range(c):
        if x==500*i+100*ii+50*iii:
          ans+=1
          
  return ans
a=input()
b=input()
c=input()
x=input()
print(tyoudo(a,b,c,x))

Fixed code:
def tyoudo(a,b,c,x):
  ans=0
  for i in range(a+1):
    for ii in range(b+1):
      for iii in range(c+1):
        if x==500*i+100*ii+50*iii:
          ans+=1
  return ans
a=int(input())
b=int(input())
c=int(input())
x=int(input())
print(tyoudo(a,b,c,x))