let solve a b c x =
  let rec decide_a p x = (* 500円をp枚使っていて、x円残っている *)
    if x = 0 then 1 else
    (if p < a then decide_a (p+1) (x-500) else 0) + decide_b 0 x
  and decide_b q x =
    if x = 0 then 1 else
    (if q < b then decide_b (q+1) (x-100) else 0) + decide_c 0 x
  and decide_c r x =
    if x = 0 then 1 else
    (if r < c then decide_c (r+1) (x-50) else 0)
  in decide_a 0 x

let () =
  Scanf.scanf "%d %d %d %d\n" (fun a b c x -> 
  Printf.printf "%d\n" @@ solve a b c x
  )