R=range;a,b,c,x=[int(eval(input()))+1for _ in[0]*4];print((sum(x-1==(10*s+2*t+r)*50for s in R(a)for t in R(b)for r in R(c))))
a,b,c,x=[int(eval(input()))+1for _ in[0]*4];print((sum(c>x/50-s*10-t*2>0for s in range(a)for t in range(b))))
R = range
a, b, c, x = [int(eval(input())) + 1 for _ in [0] * 4]
print(
    (sum(x - 1 == (10 * s + 2 * t + r) * 50 for s in R(a) for t in R(b) for r in R(c)))
)

a, b, c, x = [int(eval(input())) + 1 for _ in [0] * 4]
print((sum(c > x / 50 - s * 10 - t * 2 > 0 for s in range(a) for t in range(b))))

-R = range -print( -    (sum(x - 1 == (10 * s + 2 * t + r) * 50 for s in R(a) for t in R(b) for r in R(c))) -) +print((sum(c > x / 50 - s * 10 - t * 2 > 0 for s in range(a) for t in range(b))))