let () =
  let a = Scanf.scanf "%d " (fun a -> a) in
  let b = Scanf.scanf "%d " (fun a -> a) in
  let c = Scanf.scanf "%d " (fun a -> a) in
  let x = Scanf.scanf "%d " (fun a -> a) in

  let res = ref 0 in

  for i = 0 to a do
    for j = 0 to b do
      for k = 0 to c do
        if 500*i + 100*j + 50*k = x then res := !res + 1 else ()
      done;
    done;
  done;

  Printf.printf "%d\n" !res
