    let A = Int(readLine()!)!
    let B = Int(readLine()!)!
    let C = Int(readLine()!)!
    let X = Int(readLine()!)!
    
    if (A == 0) && (B == 0) && (C == 0) {
        //exit(0)
    }
    
    if (50...20000 ~= X) && (X % 50 != 0) {
        //exit(0)
    }
    
    var collectCount = 0
    for _500Coins in 0...A{
        for _100Coins in 0...B{
            for _50Coins in 0...C{
                let totalPrice = _500Coins * 500 + _100Coins * 100 + _50Coins * 50
                if X == totalPrice{
                    collectCount += 1
                }
            }
        }
    }
    
    print(collectCount)