let () =
  let r, g, b, n = Scanf.scanf "%d %d %d %d\n" (fun r g b n -> r, g, b, n) in
  let cnt = ref 0 in
  for i = 0 to 3000 do
    for j = 0 to 3000 do
      let tmp = i * r + j * g in
      if n - tmp >= 0 && (n - tmp) mod b = 0 then cnt := !cnt + 1;
    done;
  done;
  print_int !cnt