let () = Scanf.scanf "%d %d %d %d" @@ fun a b c x ->
  Printf.printf "%d\n" @@ List.length @@ List.filter (( = ) x) @@
    List.concat @@ Array.to_list @@ Array.init (a + 1) @@ fun i ->
      List.concat @@ Array.to_list @@ Array.init (b + 1) @@ fun j ->
        Array.to_list @@ Array.init (c + 1) @@ fun k -> 500 * i + 100 * j + 50 * k