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());
		
		int n = Integer.parseInt(str.nextToken());
		int k = Integer.parseInt(str.nextToken());
		
		int[] a = new int[n];
		
		str = new StringTokenizer(f.readLine());
		
		for(int i = 0; i < n; i++) {
			
			a[i] = Integer.parseInt(str.nextToken());
			
		}
		
		
		int day = 0;
		
		boolean fresh = true;
		
		long bags = 0;
		
		while(day < n-1) {
			
			if(fresh) {
				
				int moreBags = a[day] / k;
				bags += moreBags;
				a[day] -= moreBags*k;
				a[day+1] += a[day];
				fresh = false;
				
				day++;
				
			} else {
				
				if(a[day] < k) {
					
					if(a[day] != 0) {
						
						bags++;
						
					}
					
					fresh = true;
					
					day++;
					
				} else {
					
					int moreBags = a[day] / k;
					bags += moreBags;
					a[day] -= moreBags*k;
					a[day+1] += a[day];
					
					if(a[day] == 0) {
						fresh = true;
					}
					
					day++;
					
				}
				
			}
			
		}
		
		bags += a[n-1] / k;
		
		if(a[n-1] % k != 0) {
			bags += 1;
		}
		
		System.out.println(bags);
		
		f.close();
		
	}
	
}