A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

cnt = 0



for i in range(A + 1):

  for j in range(B + 1):

    for k in range(C + 1):

      if X == i * 500 + j * 100 + k * 50:

        cnt += 1

        

print(cnt)
A = int(eval(input()))

B = int(eval(input()))

C = int(eval(input()))

X = int(eval(input()))

cnt = 0



for i in range(A + 1):

  for j in range(B + 1):

    y = X - i * 500 - j * 100

    if y % 50 == 0 and 0 <= y <=50*C:

        cnt += 1

        

print(cnt)
A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
cnt = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if X == i * 500 + j * 100 + k * 50:
                cnt += 1
print(cnt)

A = int(eval(input()))
B = int(eval(input()))
C = int(eval(input()))
X = int(eval(input()))
cnt = 0
for i in range(A + 1):
    for j in range(B + 1):
        y = X - i * 500 - j * 100
        if y % 50 == 0 and 0 <= y <= 50 * C:
            cnt += 1
print(cnt)

-        for k in range(C + 1): -            if X == i * 500 + j * 100 + k * 50: -                cnt += 1 +        y = X - i * 500 - j * 100 +        if y % 50 == 0 and 0 <= y <= 50 * C: +            cnt += 1