import numpy as np

import sys

a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

value = [i*500 + j*100 + k*50 for i in range(a+1) for j in range(b+1) for k in range(c+1)]

print((value.count(x)))

a=int(eval(input()))

b=int(eval(input()))

c=int(eval(input()))

x=int(eval(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)

import numpy as np
import sys

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
value = [
    i * 500 + j * 100 + k * 50
    for i in range(a + 1)
    for j in range(b + 1)
    for k in range(c + 1)
]
print((value.count(x)))

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(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)

-import numpy as np -import sys - -value = [ -    i * 500 + j * 100 + k * 50 -    for i in range(a + 1) -    for j in range(b + 1) -    for k in range(c + 1) -] -print((value.count(x))) +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)