let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var r: Int = 0, g: Int = 0, b: Int = 0
var i: Int = 0
var j: Int = 0
var k: Int = 0
var o: Int = 0

var z: Int = ( arr[3] / arr[0] )
var x: Int = ( arr[3] / arr[1] )
var c: Int = ( arr[3] / arr[2] )

for r = 0; r <= ( z ); r += 1 {
  i = r * arr[0]
  for g = 0; g <= ( x ); g += 1 {
    j = g * arr[1]
    for b = 0; b <= ( c ); b += 1 {
      k = b * arr[2]
      if ( ( i + j + k )  == arr[3] ) {
        o += 1
      }
    }
  }
}
  
print( o )