local ior = io.read
local am, bm, cm, x = ior("*n", "*n", "*n", "*n")

local cnt = 0
for a = 0, am do for b = 0, bm do for c = 0, cm do
  if(a * 500 + b * 100 + c * 50 == x) then cnt = cnt + 1 end
end end end
print(cnt)
