"use strict"
function main(arg) {
    arg = arg.trim().split("\n")[0].split(" ").map(Number)
    var r = arg[0]
    var g = arg[1]
    var b = arg[2]
    var n = arg[3]
    var count = 0
    var MAX = Number.MAX_SAFE_INTEGER
    for (var i = 0; i < MAX; i++) {
        var _r = r * i
        if (_r > n) break
        for (var j = 0; j < MAX; j++) {
            var _g = g * j
            if (_g > n) break
            for (var k = 0; k < MAX; k++) {
                var _b = b * k
                if (_b > n) break
                var v = _r + _g + _b
                if (v > n) break
                if (v === n) {
                    count++
                }
            }
        }
    }
    console.log(count)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));