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

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

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