import numpy as np



a = int(input())

b = int(input())

c = int(input())

x = int(input())



n = 0

i = 0

while i * 500 <= x and i <= a:

    if i * 500 == x:

        n += 1

#        print 10

    else:

        y = x - i * 500

        j = 0

        while j * 100 <= y and j <= b:

            if j * 100 == y:

                n += 1

#                print 20

            else:

                z = y - j * 100

                if z / 50 <= c:

                    n += 1

#                    print 30

            j += 1

    i += 1



print(n)

a = int(input())

b = int(input())

c = int(input())

x = int(input())



n = 0

i = 0

while i * 500 <= x and i <= a:

    if i * 500 == x:

        n += 1

#        print 10

    else:

        y = x - i * 500

        j = 0

        while j * 100 <= y and j <= b:

            if j * 100 == y:

                n += 1

#                print 20

            else:

                z = y - j * 100

                if z / 50 <= c:

                    n += 1

#                    print 30

            j += 1

    i += 1



print(n)
import numpy as np

a = int(input())
b = int(input())
c = int(input())
x = int(input())
n = 0
i = 0
while i * 500 <= x and i <= a:
    if i * 500 == x:
        n += 1
    #        print 10
    else:
        y = x - i * 500
        j = 0
        while j * 100 <= y and j <= b:
            if j * 100 == y:
                n += 1
            #                print 20
            else:
                z = y - j * 100
                if z / 50 <= c:
                    n += 1
            #                    print 30
            j += 1
    i += 1
print(n)

a = int(input())
b = int(input())
c = int(input())
x = int(input())
n = 0
i = 0
while i * 500 <= x and i <= a:
    if i * 500 == x:
        n += 1
    #        print 10
    else:
        y = x - i * 500
        j = 0
        while j * 100 <= y and j <= b:
            if j * 100 == y:
                n += 1
            #                print 20
            else:
                z = y - j * 100
                if z / 50 <= c:
                    n += 1
            #                    print 30
            j += 1
    i += 1
print(n)

-import numpy as np -