coins = []

for i in range(0, 4):

  coins.append(int(eval(input())))



count = 0



for i in range(0, coins[0] + 1):

  for j in range(0, coins[1] + 1):

    for k in range(0, coins[2] + 1):

      ans = 500*i + 100*j + 50*k

      if ans == coins[3]:

        count += 1

print(count)





url = "https://atcoder.jp/contests/abc087/tasks/abc087_b"



def main():

    coins = [int(eval(input())) for v in range(3)]

    che = int(eval(input()))

    count = 0

    for i in range(0, coins[0] + 1):

        for j in range(0, coins[1] + 1):

            for k in range(0, coins[2] + 1):

                if che == (500 * i) + (100 * j) + (50 * k):

                    count += 1

    print(count)





if __name__ == '__main__':

    main()





coins = []
for i in range(0, 4):
    coins.append(int(eval(input())))
count = 0
for i in range(0, coins[0] + 1):
    for j in range(0, coins[1] + 1):
        for k in range(0, coins[2] + 1):
            ans = 500 * i + 100 * j + 50 * k
            if ans == coins[3]:
                count += 1
print(count)

url = "https://atcoder.jp/contests/abc087/tasks/abc087_b"


def main():
    coins = [int(eval(input())) for v in range(3)]
    che = int(eval(input()))
    count = 0
    for i in range(0, coins[0] + 1):
        for j in range(0, coins[1] + 1):
            for k in range(0, coins[2] + 1):
                if che == (500 * i) + (100 * j) + (50 * k):
                    count += 1
    print(count)


if __name__ == "__main__":
    main()

-coins = [] -for i in range(0, 4): -    coins.append(int(eval(input()))) -count = 0 -for i in range(0, coins[0] + 1): -    for j in range(0, coins[1] + 1): -        for k in range(0, coins[2] + 1): -            ans = 500 * i + 100 * j + 50 * k -            if ans == coins[3]: -                count += 1 -print(count) +url = "https://atcoder.jp/contests/abc087/tasks/abc087_b" + + +def main(): +    coins = [int(eval(input())) for v in range(3)] +    che = int(eval(input())) +    count = 0 +    for i in range(0, coins[0] + 1): +        for j in range(0, coins[1] + 1): +            for k in range(0, coins[2] + 1): +                if che == (500 * i) + (100 * j) + (50 * k): +                    count += 1 +    print(count) + + +if __name__ == "__main__": +    main()