open Printf open Scanf
open Array

let () = scanf " %d %d %d %d" @@ fun r g b n ->
  let res = ref 0 in
  for i=0 to n/r do
    for j=0 to n/g do
      let k = n - i*r - j*g in
      if 0<=k && k mod b = 0 then (
        (* printf "%d %d %d\n"
          i j (k/b); *)
        incr res
      )
    done;
  done;
  print_int @@ !res

