function main(arg) {
    arg = arg.split("\n")
    var x = parseInt(arg[0].split(" ")[1], 10)
    var ai = arg[1].split(" ").map((e) => parseInt(e, 10))

    var count = ai.slice().fill(0)
    var max = x
    var min = Math.min.apply(null, ai)

    for(;;) {
        if (max < min) {
            break;
        }
        
        for (var i = 0; i < ai.length; i++) {
            if((max - ai[i]) >= 0) {
                max -= ai[i]
                count[i] ++
            }
        }
    }
    
    var count2 = 0
    count.forEach((e) => {
        if(1 === e) {
            count2++
        }
    })
    
    console.log(count2)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));