import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class solutionn {
	
	public static void main(String[] args) throws IOException {
		
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer str = new StringTokenizer(f.readLine());
		
		long n = Long.parseLong(str.nextToken());
		long k = Long.parseLong(str.nextToken());
		
		long[] a = new long[(int) n];
		
		str = new StringTokenizer(f.readLine());
		
		for(int i = 0; i < n; i++) {
			
			a[i] = Long.parseLong(str.nextToken());
			
		}
		
		
		long day = 0;
		
		boolean fresh = true;
		
		long bags = 0;
		
		while((long) day < (long) n-1) {
			
			if(fresh) {
				
				long moreBags = (long) ((long) a[(int) day] / (long) k);
				bags += (long) moreBags;
				a[(int) day] -= (long) ((long) moreBags)*((long) k);
				a[(int) day+1] += (long) a[(int) day];
				fresh = false;
				
				day++;
				
			} else {
				
				if((long) a[(int) day] < (long) k) {
					
					bags += 1;
					fresh = true;
					
					day++;
					
				} else {
					
					long moreBags = (long) ((long) a[(int) day] / (long) k);
					bags += (long) moreBags;
					a[(int) day] -= (long) ((long) moreBags)*((long) k);
					a[(int) day+1] += (long) a[(int) day];
					
					day++;
					
				}
				
			}
			
		}
		
		bags += (long) ((long) a[(int) n-1] / (long) k);
		
		if((long) a[(int) n-1] % (long) k != 0) {
			bags += 1;
		}
		
		System.out.println(bags);
		
		f.close();
		
	}
	
}