object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    // 1 <= R,G,B,N <= 3000
    val x = sc.nextInt
    val y = sc.nextInt
    val z = sc.nextInt
    val n = sc.nextInt
    val r = n / x
    val g = n / y
    val b = n / z
    var count = 0

    for (i <- 0 to r) {
      for (j <- 0 to g) {
        for (k <- 0 to b) {
          if (((i * x) + (j * y) + (k * z)) == n) {
            count += 1
          }
        }
      }
    }

    println(count)
  }
}
