Module Module087B
    Sub Main(ByVal args() As String)
        Dim A As Integer : A = 0
        Dim B As Integer : B = 0
        Dim C As Integer : C = 0
        Dim X As Integer : X = 0
        Dim result As Integer : result = 0
        Dim i, j, k

        A = Console.ReadLine()
        B = Console.ReadLine()
        C = Console.ReadLine()
        X = Console.ReadLine()

        For i = 0 To A
            If X < 500 * i Then
                Exit For
            End If

            For j = 0 To B
                If X < 500 * i + 100 * j Then
                    Exit For
                End If

                For k = 0 To C
                    If X = 500 * i + 100 * j + 50 * k Then
                        result = result + 1
                    End If
                Next
            Next
        Next

        Console.Write(result)
    End Sub
End Module
