a = int(input())

b = int(input())

c = int(input())

x = int(input())



def dfs(x, i, m, v):

  	if x < 0: return 0

  	if x == 0 or i == 3: 

  		return 1 if x == 0 else 0   	

  	r = 0

  	for k in range(0, m[i] + 1): r += dfs(x - k * v[i], i + 1, m, v)

  	return r

m,v = {0:a,1:b,2:c}, {0:500,1:100,2:50}

print(dfs(x,0,m,v))

m,v = {i: int(input()) for i in range(3)}, {0:500,1:100,2:50}

x = int(input())



def dfs(x, i, m, v):

  	if x < 0: return 0

  	if x == 0 or i == 3: 

  		return 1 if x == 0 else 0   	

  	r = 0

  	for k in range(0, m[i] + 1): r += dfs(x - k * v[i], i + 1, m, v)

  	return r

print(dfs(x,0,m,v))

a = int(input())
b = int(input())
c = int(input())
x = int(input())


def dfs(x, i, m, v):
    if x < 0:
        return 0
    if x == 0 or i == 3:
        return 1 if x == 0 else 0
    r = 0
    for k in range(0, m[i] + 1):
        r += dfs(x - k * v[i], i + 1, m, v)
    return r


m, v = {0: a, 1: b, 2: c}, {0: 500, 1: 100, 2: 50}
print(dfs(x, 0, m, v))

m, v = {i: int(input()) for i in range(3)}, {0: 500, 1: 100, 2: 50}
x = int(input())


def dfs(x, i, m, v):
    if x < 0:
        return 0
    if x == 0 or i == 3:
        return 1 if x == 0 else 0
    r = 0
    for k in range(0, m[i] + 1):
        r += dfs(x - k * v[i], i + 1, m, v)
    return r


print(dfs(x, 0, m, v))

-a = int(input()) -b = int(input()) -c = int(input()) +m, v = {i: int(input()) for i in range(3)}, {0: 500, 1: 100, 2: 50} -m, v = {0: a, 1: b, 2: c}, {0: 500, 1: 100, 2: 50}