import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val r = sc.nextLong()
  val g = sc.nextLong()
  val b = sc.nextLong()
  val n = sc.nextLong()

  var count = 0L
  for (ri in 0L..n/r) {
    for (gi in 0L..n/g) {
      val tmp = r * ri + g * gi
      val last = n - tmp
      if (last < 0L) {
        continue
      }
      if (last == 0L) {
        count++
        continue
      }
      if (last % b == 0L) {
        count++
      }
    }
  }


  println(count)
}
