Module Module1

sub Main(ByVal args() as String)
    dim A as integer = Console.ReadLine()
    dim B as integer = Console.ReadLine()
    dim C as integer = Console.ReadLine()
    dim X as integer = Console.ReadLine()

    dim cnt as integer = 0
    for i as integer = 0 to A
    for j as integer = 0 to B
    for k as integer = 0 to C
        if 500 * i + 100 * j + 50 * k = X then
            cnt += 1
        end if
    next k
    next j
    next i

    Console.WriteLine(cnt)
end sub

end Module