import java.util.*;

public class dispose
{
	public static void main(String[] args)
	{
		Scanner s = new Scanner(System.in);
		StringTokenizer st = new StringTokenizer(s.nextLine());
		long n = Integer.parseInt(st.nextToken());
		long k = Integer.parseInt(st.nextToken());
		
		StringTokenizer st2 = new StringTokenizer(s.nextLine());
		ArrayList<Integer> amt = new ArrayList<Integer>();
		int totalGarbage = 0;
		long bags = 0;
		for (int i = 0; i < n; i++)
		{
			amt.add(Integer.parseInt(st2.nextToken()));
		}
		for (int i = 0; i < n; i++)
		{
			totalGarbage += amt.get(i);
			if (i > 0)
			{
				if (amt.get(i) + amt.get(i-1) >= k)
				{
					bags += (long) Math.floorDiv(totalGarbage, k);
					totalGarbage %= k;
				}
				else
				{
					if (totalGarbage != 0)
					{
						totalGarbage = 0;
						bags++;
					}
				}
			}
		}
		if (totalGarbage > 0)
		{
			bags++;
		}
		System.out.print(bags);
		s.close();
	}
}