a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

i1, i2, i3, p = 0, 0, 0, 0

while i1 <= a:

  while i2 <= b:

    while i3 <= c:

      m = 500 * i1 + 100 * i2 + 50 * i3

      if m == x:

        p += 1

      i3 += 1

    i3 = 0

    i2 += 1

  i2 = 0

  i1 += 1

print(p)
a = int(eval(input()))

b = int(eval(input()))

c = int(eval(input()))

x = int(eval(input()))

i1, i2, i3, p = 0, 0, 0, 0

while i1 <= a:

  while i2 <= b:

    while i3 <= c:

      m = 500 * i1 + 100 * i2 + 50 * i3

      if m > x:

        break

      elif m == x:

        p += 1

      i3 += 1

    i3 = 0

    i2 += 1

  i2 = 0

  i1 += 1

print(p)
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
    while i2 <= b:
        while i3 <= c:
            m = 500 * i1 + 100 * i2 + 50 * i3
            if m == x:
                p += 1
            i3 += 1
        i3 = 0
        i2 += 1
    i2 = 0
    i1 += 1
print(p)

a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
x = int(eval(input()))
i1, i2, i3, p = 0, 0, 0, 0
while i1 <= a:
    while i2 <= b:
        while i3 <= c:
            m = 500 * i1 + 100 * i2 + 50 * i3
            if m > x:
                break
            elif m == x:
                p += 1
            i3 += 1
        i3 = 0
        i2 += 1
    i2 = 0
    i1 += 1
print(p)

-            if m == x: +            if m > x: +                break +            elif m == x: