Problem:
 Score : 200 points    Problem Statement You have A  500 -yen coins, B  100 -yen coins and C  50 -yen coins (yen is the currency of Japan).
In how many ways can we select some of these coins so that they are X yen in total?  Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.      Constraints  0 \leq A, B, C \leq 50  A + B + C \geq 1  50 \leq X \leq 20  000  A , B and C are integers.  X is a multiple of 50 .         Input Input is given from Standard Input in the following format:  A  B  C  X       Output Print the number of ways to select coins.        Sample Input 1 2
2
2
100      Sample Output 1 2  There are two ways to satisfy the condition:   Select zero 500 -yen coins, one 100 -yen coin and zero 50 -yen coins.  Select zero 500 -yen coins, zero 100 -yen coins and two 50 -yen coins.        Sample Input 2 5
1
0
150      Sample Output 2 0  Note that the total must be exactly X yen.       Sample Input 3 30
40
50
6000      Sample Output 3 213

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count=0

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

print(count)

Solution (Python):
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)

Solution (Python):
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):
            p = 500*i + 100*j + 50*k
            if p == x:
                cnt +=1
print(cnt)

Solution (Python):
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 500*i+100*j+50*k == x:
        ans += 1
print(ans)

Solution (Python):
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)

Solution (Python):
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 X == (500 * i) + (100 * j) + (50 * k):
                ans += 1
print(ans)

Solution (Python):
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 500 * i + 100 * j + 50 * k == x:
                cnt += 1
print(cnt)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
sum_=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):
            check=500*i+100*j+50*k
            if(check==sum_):
                count+=1
print(count)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for i in range(0,A+1):
    for j in range(0,B+1):
        for k in range(0,C+1):
            price = 500 * i + 100 * j + 50 * k
            if price == X:
                cnt += 1
print(cnt)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0
for i in range(A+1):
    X_ = X
    X_ -= 500*i
    for j in range(B+1):
        X__ = X_
        X__ -= 100*j
        for k in range(C+1):
            X___ = X__
            X___ -= 50*k
            if X___ == 0:
                cnt += 1
print(cnt)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
g = int(input())
tmp = []
for x in range(a+1):
    for y in range(b+1):
        for z in range(c+1):
            tmp.append(500*x + 100*y + 50*z)
ans = tmp.count(g)
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
L = []
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:
                L.append((a,b,c))
print(len(L))

Solution (Python):
def answer(a: int, b: int, c: int, x: int) -> int:
    count = 0
    for i in range(0, a + 1):
        for j in range(0, b + 1):
            for k in range(0, c + 1):
                if x == i * 500 + j * 100 + k * 50:
                    count += 1

    return count


def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    print(answer(a, b, c, x))


if __name__ == '__main__':
    main()

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
if x%100>0 and c==0:
    print(0)
    exit()
else:
    a=min(a,x//500)
    b=min(b,x//100)
    c=min(c, x // 50)
    ans=0
    for i in range(a+1):
        for j in range(b+1):
            for c in range(c+1):
                if i*500+j*100+c*50==x:ans+=1
print(ans)

Solution (Python):
def main():

    five_hundred = int(input())
    one_hundred = int(input())
    fifty = int(input())
    x = int(input())
    ans = 0
    for i in range(five_hundred + 1):
        for j in range(one_hundred + 1):
            for k in range(fifty + 1):
                if 500 * i + 100 * j + 50 * k == x:
                    ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
res = 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:
        res += 1
print(res)

Solution (Python):
[a]=[int(i) for i in input().split()]
[b]=[int(i) for i in input().split()]
[c]=[int(i) for i in input().split()]
[x]=[int(i) for i in input().split()]
ans=0
for ia in range(a+1):
    for ib in range(b+1):
        for ic in range(c+1):
            if(ia*500+ib*100+ic*50==x):
                ans+=1
print(ans)

Solution (Python):
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 500 * i + 100 * j + 50 * k == x:
                cnt += 1
                break
            elif 500 * i + 100 * j + 50 * k > x:
                break
print(cnt)

Solution (Python):
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 500*i + 100*j + 50*k == x:
        ans += 1
print(ans)

Solution (Python):
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 500 * i + 100 * j + 50 * k == x:
                ans += 1
print(ans)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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 X == 500*i + 100*j + 50*k:
                cnt+=1

print(cnt)

Solution (Python):
A = input()
B = input()
C = input()
X = input()

A=int(A)
B=int(B)
C=int(C)
X=int(X)

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

print(count)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0

for a_idx in range(a + 1):
  for b_idx in range(b + 1):
    for c_idx in range(c + 1):
      total = 500 * a_idx + 100 * b_idx + 50 * c_idx
      if (total == x): cnt += 1

print(cnt)

Solution (Python):
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):
      cand = 500 * i + 100 * j + 50 * k
      if cand == x:
        cnt += 1
print(cnt)

Solution (Python):
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 ==  500 * i + 100 * j + 50 * k:
                 count += 1
print(count)

Solution (Python):
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 500*i + 100*j + 50*k == x:
        ans += 1
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

pat = 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:
				pat += 1
print(pat)

Solution (Python):
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)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x1 = int(input())
x2 = 0
ans = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
                x2 = 500*i + 100*j + 50*k
                if (x2==x1):
                    ans+=1

print(ans)

Solution (Python):
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 = ans + 1
print(ans)

Solution (Python):
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 500*i + 100*j + 50*k == x:
                cnt += 1

print(cnt)

Solution (Python):
with open(0) as f:
    a, b, c, x = map(int, f.read().split())
cnt = 0
from itertools import product
for i,j,k in product(range(a+1), range(b+1), range(c+1)):
    if 500*i + 100*j + 50*k == x:
        cnt += 1
print(cnt)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

print(ans)

Solution (Python):
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 * int(i) + 100 * int(j) + 50 * int(k)
            if sum == X:
                count += 1

print(count)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

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

print(ans)

Solution (Python):
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)

Solution (Python):
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 a * 500 + b * 100 + c * 50 == X:
        ans += 1
print(ans)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
x=int(input())

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

Solution (Python):
A = int(input())  
B = int(input())  
C = int(input())  
X = int(input())  

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

Solution (Python):
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 500*i+100*j+50*k==x:
        ans += 1
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0

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

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

print(result)

Solution (Python):
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)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

suma = 0
sumb = 0
sumc = 0

la = list([0])
lb = list([0])
lc = list([0])

ls = list()
for i in range(1,A+1):
    suma = suma + 500
    la.append(suma)

for i in range(1,B+1):
    sumb = sumb + 100
    lb.append(sumb)

for i in range(1,C+1):
    sumc = sumc + 50
    lc.append(sumc)

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            ls.append(la[i]+lb[j]+lc[k])
            
print(ls.count(X))

Solution (Python):
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(500*i+100*j+50*k)==X:
        ans += 1
print(ans)

Solution (Python):
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("{}".format(count))

Solution (Python):
(A, B, C, X) = [int(input()) for i in range(4)]
ways = 0

max_a = int( X / 500 )
if A < max_a :
  max_a = A
for a in reversed(range( max_a+1 )) :
  max_b = int( (X - 500 * a) / 100 )
  if B < max_b :
    max_b = B
  for b in reversed(range( max_b+1 )) :
    c = int ( ( X - 500 * a - 100 * b ) / 50 )
    if c > C :
      break
    ways += 1
print('%d' %ways ) ;

Solution (Python):
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):
        if (x-(500*i + 100*j))%50==0 and ((x-(500*i+100*j))//50)<=c and (500*i+100*j)<=x:
            ans += 1
            
print(ans)

Solution (Python):


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):
            value = 500*i+100*j+50*k
            if value == x:
                ans += 1

print(ans)

Solution (Python):
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):
            total = 500*a + 100*b + 50*c
            if total==x:
                ans+=1
print(ans)

Solution (Python):
a_coins = int(input())
b_coins = int(input())
c_coins = int(input())
x_num = int(input())

def money_match(a, b, c):
    money = 500 * a + 100 * b + 50 * c
    if money == x_num:
        return 1
    else:
        return 0
        
cnt = 0
for a in range(a_coins+1):
    for b in range(b_coins+1):
        for c in range(c_coins+1):
            if money_match(a, b, c) == 1:
                cnt += 1
                
print(cnt)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for aa in range(a + 1):
    for bb in range(b + 1):
        for cc in range(c + 1):
            if 500 * aa + 100 * bb + 50 * cc == x:
                ans += 1
print(ans)

Solution (Python):
import sys
from itertools import islice, tee


def resolve(in_):
    A = int(next(in_))
    B = int(next(in_))
    C = int(next(in_))
    X = int(next(in_))

    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 == X:
                    ans += 1

    return ans


def main():
    answer = resolve(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
A, B, C, X = [int(input()) for i in range(4)]
print(sum(500*a + 100*b + 50*c == X for a in range(A+1) for b in range(B+1) for c in range(C+1)))

Solution (Python):
A, B, C, X = [int(input()) for i in range(4)]
cnt = 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:
        cnt += 1
print(cnt)

Solution (Python):

A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

print(ans)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

import sys
input=sys.stdin.readline

def main():
    a = int(input())
    b = int(input())
    c = int(input())
    target = 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)==target:
                    count+=1
                else:
                    continue
    print(count)

if __name__=="__main__":
    main()

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for an in range(a+1):
  for bn in range(b+1):
    for cn in range(c+1):
      if x == 500*an + 100*bn + 50*cn:
        cnt += 1
print(cnt)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
ans=0
for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      if 500*i+100*j+50*k==d:
        ans+=1
print(ans)

Solution (Python):
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 x==500*i+100*j+50*k:
        ans+=1
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())//50

ans = 0
for a, b, c in [(a, b, c) for a in range(A+1) for b in range(B+1) for c in range(C+1)]:
  if 10*a + 2*b + c == X:
    ans += 1

print(ans)

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

print(ans)

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

Solution (Python):
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)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

Solution (Python):
a, b, c, x = map(int, [input() for i in range(4)])

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

Solution (Python):
s = [int(input()) for i in range(4)]
A = s[0]
B = s[1]
C = s[2]
X = s[3]
res = 0
total = 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):res = res +1
print(res)

Solution (Python):
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 500 * i + 100 * j + 50 * k == x:
        cnt += 1
        
print(cnt)

Solution (Python):
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):
        if (X - (500*i+100*j)) % 50 == 0 and X - (500*i+100*j) >= 0 and (X - (500*i+100*j)) // 50 <= C:
            ans += 1
print(ans)

Solution (Python):
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 500*i+100*j+50*k == X:
                ans += 1
print(ans)

Solution (Python):
import sys
import copy
import math
import itertools
import numpy as np

A=int(input())
B=int(input())
C=int(input())
X=int(input())
cnt = 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:
                cnt+=1
print(cnt)

Solution (Python):

a = int(input())

b = int(input())

c = int(input())
x = int(int(input())/50)
d = [0] * x
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 10*i+2*j+k == x:
                ans += 1
print(ans)

Solution (Python):
mycode = r'''











ctypedef long long LL


import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.readline 

cdef LL a_int(): return int(readline())

cdef LL i,j,k,_


A=a_int()
B=a_int()
C=a_int()
X=a_int() 


cdef LL a,b,c,ans 
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            ans += (500*a + 100*b + 50*c == X)
print(ans)


'''

import sys
if sys.argv[-1] == 'ONLINE_JUDGE':  
    import os
    with open('mycode.pyx', 'w') as f:
        f.write(mycode)
    os.system('cythonize -i -3 -b mycode.pyx')

import mycode

Solution (Python):
mycode = r'''











ctypedef long long LL


import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.readline 

cdef LL a_int(): return int(readline())

cdef LL i,j,k,_


cdef LL A=a_int()
cdef LL B=a_int()
cdef LL C=a_int()
cdef LL X=a_int()


cdef LL a,b,c,ans
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            ans += (500*a + 100*b + 50*c == X)
print(ans)

'''

import sys
if sys.argv[-1] == 'ONLINE_JUDGE':  
    import os
    with open('mycode.pyx', 'w') as f:
        f.write(mycode)
    os.system('cythonize -i -3 -b mycode.pyx')

import mycode

Solution (Python):
a , b, c , x = [int(input()) for i in range(4)]
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)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
con = 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:
        con += 1
print(con)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

if x%50 > 0:
    print(0)
    exit()
    
ans = 0
for a_c in range(a+1):
    for b_c in range(b+1):
        amount = 500 * a_c + 100 * b_c
        if 0 <= x - amount <= 50 * c:
            ans += 1

print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A + 1):
  if 500 * i > X:
    break
  for j in range(B + 1):
    if 500 * i + 100 * j > X:
      break
    if X - 500 * i - 100 * j <= 50 * C:
      ans += 1
print(ans)

Solution (Python):
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    x2 = x // 50
    count = 0
    

    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if 10 * i + 2 * j + k == x2:
                    count += 1

    print(count)


if __name__ == "__main__":
    main()

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

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

Solution (Python):



A = int(input())
B = int(input())
C = int(input())
X = int(input())

i = 0
j = 0
k = 0
cnt = 0
sum = 0
while i <= A:
    j = 0
    if i>50:
        break
    while j <= B:
        k = 0
        if j>50:
            break
        while k <= C:
            if k>50:
                break
            else:
                sum = 500*i + 100*j + 50*k
                if X == sum:
                    cnt += 1
                k += 1
                sum = 0
        j += 1
    i += 1

print(cnt)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
Y = int(input())

ra = min(A,int(Y//500+1))
rb = min(B,int(Y//100+1))
rc = min(C,int(Y//50+1))


cnt = 0
for a in range(0,ra+1):
  for b in range(0,rb+1):
    for c in range(0,rc+1):
      if 500*a + 100*b + 50*c == Y:
        cnt += 1
        
print(cnt)

Solution (Python):



if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())

    ans = 0

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

    print(ans)

Solution (Python):


A, B, C, X = map(int, open(0).read().split())

count = 0

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

print(count)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

a = int(input())
b = int(input())
c = int(input())
x = int(input())

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

Solution (Python):
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 500*i+100*j+50*k==x:
                ans+=1
print(ans)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

res = 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: 
        res+=1
        
print(res)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
print(len([1 for i in range(b+1) for j in range(c+1) if (x-100*i-50*j)%500==0 and 0<=(x-100*i-50*j)/500<=a]))

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ret = 0
for a_i in range(a+1):
    for b_i in range(b+1):
        for c_i in range(c+1):
            if x == 500 * a_i + 100 * b_i + 50 * c_i:
                ret += 1

print(ret)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(int(input())/50)

cnt = 0

for i in range(a + 1):
  for j in range(b + 1):
    for k in range(c + 1):
      s = int(i*10 + j*2 + k)
      if s == x:
        cnt += 1

print(cnt)

Solution (Python):
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):
            if a*500+b*100+c*50 == X:
                count += 1

print(count)

Solution (Python):
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 500*i + 100*j + 50*k == x:
                ans += 1
print(ans)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
d = 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:
                d +=1
print(d)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
d = 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:
                d +=1
print(d)

Solution (Python):
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

import string

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



if __name__=="__main__":
    main()

Solution (Python):


A,B,C,X = [int(input()) for i in range(4)]

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)

Solution (Python):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

counter = 0

for ai in range(A + 1):
    for bi in range(B + 1):
        for ci in range(C + 1):
            if X == ai * 500 + bi * 100 + ci * 50:

                counter += 1

print(counter)

Solution (Python):
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 500*a+100*b+50*c==X:
        count+=1
print(count)

Solution (Python):

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)