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

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

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