#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int a[N];
int main() {
  int n, m, left = 0;
  scanf("%d%d", &n, &m);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (left) {
      a[i] -= m - left % m == 0 ? m : left % m;
      ans += (left + m - 1) / m;
      left = 0;
    }
    left = max(0, a[i]);
  }
  ans += (left + m - 1) / m;
  cout << ans << endl;
  return 0;
}
