import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val r = sc.nextInt
  val g = sc.nextInt
  val b  = sc.nextInt
  val n  = sc.nextInt

  val res =
  {
    for{
      i <- (0 to n / r)
      j <- (0 to n / g)
      bk = n - i * r - j * g
      if 0 <= bk && bk % b == 0
    }yield(i,j,bk / b)
  }.size

  println(res)


}