let r, g, b, n = Scanf.scanf " %d %d %d %d" @@ fun a b c d -> a, b, c, d
let ans = ref 0
let _ =
  for i = 0 to n do
    for j = 0 to n do
      let rest = n - i * r - j * g in
      if rest >= 0 && rest mod b = 0 then incr ans done done;
  Printf.printf "%d\n" !ans