Module Module1

    Sub Main()
        Dim a, b, c, x, count As Integer
        a = Console.ReadLine
        b = Console.ReadLine
        c = Console.ReadLine
        x = Console.ReadLine
        For i As Integer = a To 0 Step -1
            For j As Integer = b To 0 Step -1
                For k As Integer = c To 0 Step -1

                    If 500 * i + 100 * j + 50 * k = x Then
                            count = count + 1
                        End If

                Next
            Next
        Next
        Console.WriteLine(count)
        Console.ReadLine()

    End Sub

End Module
