fun main() = with(System.`in`.bufferedReader()) {
val n = readLine().split(" ").map{it.toInt()}
if(n[0]==0){
println(0)
return
}
val weight = readLine().split(" ").map{it.toInt()}
var sum = 0
var ans = 0
for(i in 0 until weight.size){
sum += weight[i]
if(sum>n[1]){
ans++
sum = weight[i]
}
}
println(ans+1)
}