let rec solve a b c x =
    if x = 0 then 1 else
        if 500 * a + 100 * b + 50 * c = x then 1 else
            (if x >= 500 && a >= 1 then solve (a - 1) b c (x - 500) else 0)
            + (if x >= 100 && b >= 1 then solve 0 (b - 1) c (x - 100) else 0)
            + (if x >= 50  && c >= 1 then solve 0 0 (c - 1) (x - 50)  else 0)

let () =
    let a = read_int () in
    let b = read_int () in
    let c = read_int () in
    let x = read_int () in
    print_int (solve a b c x);
    print_newline ()
