var
a:array[1..100000]of longint;
i,j,n,m,s,ans:longint;
begin
read(n,m);
for i:=1 to n do
read(a[i]);
for i:=1 to n do
if a[i]+s<=m then s:=s+a[i]
else begin s:=a[i];inc(ans);end;
write(ans+1);
end.
a:array[1..100000]of longint;
i,j,n,m,s,ans:longint;
begin
read(n,m);
for i:=1 to n do
read(a[i]);
for i:=1 to n do
if a[i]+s<=m then s:=s+a[i]
else begin s:=a[i];inc(ans);end;
write(ans+1);
end.