#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long pow(long long B, long long P) {
  long long S = 1;
  for (long long i = 1; i <= P; i++) S = S * B;
  return S;
}
long long fx4[] = {1, -1, 0, 0};
long long fy4[] = {0, 0, 1, -1};
long long A[200005], check[200005];
int main() {
  long long T, N, M, X, Y, W;
  cin >> N >> M;
  for (int i = 1; i <= N; i++) cin >> A[i];
  long long ans = 0, baki = 0;
  for (int i = 1; i <= N; i++) {
    X = A[i] + baki;
    ans += (X / M);
    baki = (X % M);
    if (X < M && i > 1 && i < N) {
      ans++;
      baki = A[i] % M;
    }
    if (A[i] == 0) {
      ans++;
      baki = 0;
    }
  }
  if (baki > 0) ans++;
  cout << ans << endl;
  return 0;
}
