const main = () => {
  const abcx = getParams()
      , a = abcx[0]
      , b = abcx[1]
      , c = abcx[2]
      , x = abcx[3];
  console.log(solve(a, b, c, x));
};

const getParams = () =>
  getStdin().split('\n').map(Number);

const getStdin = () =>
  require('fs').readFileSync('/dev/stdin', 'utf8').trim();

const solve = (a, b, c, x) =>
  exactPairs(a, b, c, x).length;

const exactPairs = (a, b, c, x) =>
  allPairs(a, b, c).filter(arr => exact(arr[0], arr[1], arr[2], x));

const allPairs = (a, b, c) =>
  range(a+1).flatMap(ai =>
    range(b+1).flatMap(bi =>
      range(c+1).map(ci =>
        [ai, bi, ci])));

const range = max =>
  [...Array(max).keys()];

const exact = (a, b, c, x) =>
  500 * a + 100 * b + 50 * c === x;

Array.prototype.flatMap = function (f) {
  return this.reduce((acc ,x) => acc.concat(f(x)), []);
};

main();
