let (r, g, b, n) = Scanf.sscanf (read_line ()) "%d %d %d %d" @@ fun r g b n -> (r, g, b, n)

let () =
  let ans = ref 0 in
  for i = 0 to n / r do
    for j = 0 to n / g do
      let sum = r * i + j * g in
      if sum <= n && (n - sum) mod b = 0 then ans := !ans + 1
    done
  done;
  Printf.printf "%d\n" !ans