let () = Scanf.scanf "%d %d %d %d" @@ fun r g b n ->
  Printf.printf "%d\n" @@
  Array.fold_left ( + ) 0 @@ Array.init (1 + n / r) @@ fun i ->
    Array.fold_left ( + ) 0 @@ Array.init (1 + n / g) @@ fun j ->
      if
        n < r * i + g * j ||
        0 < (n - r * i - g * j) mod b
      then 0 else 1