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

    let x' = if (x mod 50) = 0 then x/50 else 0 in


    let rec judge (x,a,b,c) =
      match x,a,b,c with
      | 0,_,_,_ -> 1
      | _,0,b,c ->
         begin
         match b,c with
         | 0,_ ->
            begin
            match c with
            | 0 -> 0
            | _ -> judge (x-1,0,0,c-1)
            end
         | _, _-> judge (x-2,0,b-1,c) + judge (x, 0, 0, c)
         end
        
      | _,a,b,c ->
         judge(x-10,a-1,b,c) + judge(x,0,b,c)
    in

    let ans = judge (x',a,b,c) in

    print_int ans
;;
  
