def coins():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    count = 0
    for s in range(a + 1):
        for t in range(b + 1):
            for u in range(c + 1):
                if s * 500 + t * 100 + u * 50 == x:
                    count += 1
    print(count)


coins()

1744aee5784a35ed72eb743d623c76f2ccd25afa
<mask token>

def coins():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    count = 0
    for s in range(a + 1):
        for t in range(b + 1):
            for u in range(c + 1):
                if s * 500 + t * 100 + u * 50 == x:
                    count += 1
    print(count)


<mask token>

def coins():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    count = 0
    for s in range(a + 1):
        for t in range(b + 1):
            for u in range(c + 1):
                if s * 500 + t * 100 + u * 50 == x:
                    count += 1
    print(count)


coins()
