#![allow(non_snake_case)]

macro_rules!input{(source=$s:expr,$($r:tt)*)=>{letmutiter=$s.split_whitespace();letmutnext=||{iter.next().unwrap()};input_inner!{next,$($r)*}};($($r:tt)*)=>{let stdin=std::io::stdin();let mut bytes=std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));let mut next=move||->String{bytes.by_ref().map(|r|r.unwrap()as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect()};input_inner!{next,$($r)*}};}macro_rules!input_inner{($next:expr)=>{};($next:expr,)=>{};($next:expr,$var:ident:$t:tt$($r:tt)*)=>{let$var=read_value!($next,$t);input_inner!{$next$($r)*}};}macro_rules!read_value{($next:expr,($($t:tt),*))=>{($(read_value!($next,$t)),*)};($next:expr,[$t:tt;$len:expr])=>{(0..$len).map(|_|read_value!($next,$t)).collect::<Vec<_>>()};($next:expr,chars)=>{read_value!($next,String).chars().collect::<Vec<char>>()};($next:expr,usize1)=>{read_value!($next,usize)-1};($next:expr,$t:ty)=>{$next().parse::<$t>().expect("Parseerror")};}

use std::cmp::{min, max};

fn main() {
    input!{
        n500: u32,
        n100: u32,
        n50: u32,
        X: u32,
    }

    let ans = solve((n500, n100, n50, X));
    println!("{}", ans);
}

fn solve((n500, n100, n50, X): (u32, u32, u32, u32)) -> u32 {
    // 40 * 200 * 400 ~= 10^6
    let mut ans = 0;
    for i500 in 0..max(min(X/500, n500), 0)+1 {
        let X = X - 500 * i500;
        for i100 in 0..max(min(X/100, n100), 0)+1 {
            let X = X - 100 * i100;
            for i50 in 0..max(min(X/50, n50), 0)+1 {
                if X - 50 * i50 == 0 {
                    ans += 1;
                }
            }
        }
    }
    ans
}

#[test]
fn test_solve() {
    let cases = [((2,2,2,100), 2), ((5, 1, 0, 150), 0), ((30, 40, 50, 6000), 213), ((0, 0, 100, 50), 1)];
    for (i, (args, expected)) in cases.iter().enumerate() {
        assert_eq!(solve(*args), *expected, "{}", i);
    }
}

/*
    Copyright for the `input!` macro at line #3 is held by Hideyuki Tanaka, 2019.  The
    original macro is licensed under BSD 3-clause license.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

    3. Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


Measured memory_bytes: 4352