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 = x \ 500 To 0 Step -1
            For j As Integer = x \ 100 To 0 Step -1
                For k As Integer = x \ 50 To 0 Step -1
                    If i <= a And j <= b And k <= c Then
                        If 500 * i + 100 * j + 50 * k = x Then
                            count = count + 1
                        End If
                    End If
                Next
            Next
        Next
        Console.WriteLine(count)
        Console.ReadLine()

    End Sub

End Module
