a=int(eval(input()))

b=int(eval(input()))

c=int(eval(input()))

x=int(eval(input()))

l=[]

for i in range(a+1):

	for j in range(b+1):

		for k in range(c+1):

			l.append(500*i+100*j+50*k)

print((l.count(x)))
# 入力

A=int(eval(input()))

B=int(eval(input()))

C=int(eval(input()))

X=int(eval(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)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
l = []
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            l.append(500 * i + 100 * j + 50 * k)
print((l.count(x)))

# 入力
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(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)

-a = int(eval(input())) -b = int(eval(input())) -c = int(eval(input())) -x = int(eval(input())) -l = [] -for i in range(a + 1): -    for j in range(b + 1): -        for k in range(c + 1): -            l.append(500 * i + 100 * j + 50 * k) -print((l.count(x))) +# 入力 +A = int(eval(input())) +B = int(eval(input())) +C = int(eval(input())) +X = int(eval(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)