package javaapplication25;
import java.util.Scanner;
public class JavaApplication25 {
public static void main(String[] args) {
Scanner scn=new Scanner(System.in);
int a,b,n,k,m,w[],c[],i,j;
n=scn.nextInt();
k=scn.nextInt();
m=scn.nextInt();
a=m;
b=0;
w=new int[n];
c=new int[n];
for(i=0;i<n;i++)
w[i]=scn.nextInt();
for(i=0;i<n;i++)
c[i]=w[i];
for(j=0;j<k;j++)
{a=m;
for(i=0;i<n;i++)
{if(w[i]>0&&a>w[i])
{a=w[i]-a;
w[i]=0;
b=b+1;}}
for(i=0;i<n-1;i++)
{if(w[i]>0&&(a+w[i])>w[i+1])
{w[i]=c[i];
w[i+1]=0;}}
}
System.out.print(b);
}}