#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, i, j, sum = 0, pre = 0;
  cin >> n >> m;
  long long ar[n];
  for (i = 0; i < n; i++) cin >> ar[i];
  sum = 0;
  long long cur = ar[0];
  for (i = 1; i < n; i++) {
    long long pre = cur % m;
    if (pre > 0) pre = m - pre;
    pre = min(pre, ar[i]);
    cur += pre;
    sum += (cur + m - 1) / m;
    cur = ar[i] - pre;
  }
  sum += (cur + m - 1) / m;
  cout << sum << endl;
  return 0;
}
