import Foundation

let a = Int(readLine()!)!
let b = Int(readLine()!)!
let c = Int(readLine()!)!
let x = Int(readLine()!)!

var count = 0

for i in 0...a {
    for j in 0...b {
        for k in 0...c {
            if  a*i + b*j + c*k == x{
                count += 1
            }
        }
    }
}

print(count)
