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 i*500+j*100+k*50==X:

        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):

    s=i*500+j*100

    if (X-s)%50==0 and (X-s)/50<=C and (X-s)/50>=0:

      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 i * 500 + j * 100 + k * 50 == X:
                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):
        s = i * 500 + j * 100
        if (X - s) % 50 == 0 and (X - s) / 50 <= C and (X - s) / 50 >= 0:
            cnt += 1
print(cnt)

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