A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))



counter = 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:

                counter += 1



print(counter)
a = int(input())

b = int(input())

c = int(input())

x = int(input())



def run():

 if x % 50 != 0 or a*500 + b*100 + c*50 < x:

  return 0



 #greedy

 an = 0

 bn = 0

 cn = 0

 

 xa = x

 while xa >= 500:

  xa -= 500

  an += 1

 while xa >= 100:

  xa -= 100

  bn += 1

 while xa >= 50:

  xa -= 50

  cn += 1

 if xa != 0:

  return 0 #wtf?

 

 ret = 0

 while an >= 0:

  if an <= a and bn <= b and cn <= c:

   ret += 1

  if bn > 0:

   bn -= 1

   cn += 2

  else:

   an -= 1

   bn = 5 + (cn / 2)

   cn = cn % 2

 return ret

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

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


def run():
    if x % 50 != 0 or a * 500 + b * 100 + c * 50 < x:
        return 0
    # greedy
    an = 0
    bn = 0
    cn = 0
    xa = x
    while xa >= 500:
        xa -= 500
        an += 1
    while xa >= 100:
        xa -= 100
        bn += 1
    while xa >= 50:
        xa -= 50
        cn += 1
    if xa != 0:
        return 0  # wtf?
    ret = 0
    while an >= 0:
        if an <= a and bn <= b and cn <= c:
            ret += 1
        if bn > 0:
            bn -= 1
            cn += 2
        else:
            an -= 1
            bn = 5 + (cn / 2)
            cn = cn % 2
    return ret


print(run())

-A = int(eval(input())) -B = int(eval(input())) -C = int(eval(input())) -X = int(eval(input())) -counter = 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: -                counter += 1 -print(counter) +a = int(input()) +b = int(input()) +c = int(input()) +x = int(input()) + + +def run(): +    if x % 50 != 0 or a * 500 + b * 100 + c * 50 < x: +        return 0 +    # greedy +    an = 0 +    bn = 0 +    cn = 0 +    xa = x +    while xa >= 500: +        xa -= 500 +        an += 1 +    while xa >= 100: +        xa -= 100 +        bn += 1 +    while xa >= 50: +        xa -= 50 +        cn += 1 +    if xa != 0: +        return 0  # wtf? +    ret = 0 +    while an >= 0: +        if an <= a and bn <= b and cn <= c: +            ret += 1 +        if bn > 0: +            bn -= 1 +            cn += 2 +        else: +            an -= 1 +            bn = 5 + (cn / 2) +            cn = cn % 2 +    return ret + + +print(run())