#include <bits/stdc++.h>
using namespace std;
int main() {
  int d, k;
  cin >> d >> k;
  int a[d];
  for (int i = 0; i < d; i++) {
    cin >> a[i];
  }
  long long int tot_bags = 0, bags = 0;
  int flag = 0;
  for (int i = 0; i < d; i++) {
    if (a[i] == 0)
      bags = 0;
    else if (i == d - 1) {
      if (a[i] % k == 0)
        bags = a[i] / k;
      else
        bags = (a[i] / k) + 1;
    } else {
      if (flag == 0) {
        if (a[i] / k == 0) {
          a[i + 1] = a[i] + a[i + 1];
          flag = 1;
          bags = 0;
        } else {
          bags = a[i] / k;
          a[i + 1] += a[i] % k;
        }
      } else {
        flag = 0;
        if (a[i] / k >= 1) {
          bags = a[i] / k;
          a[i + 1] += a[i] % k;
        } else
          bags = 1;
      }
    }
    tot_bags += bags;
    bags = 0;
  }
  cout << endl;
  cout << tot_bags << endl;
  return 0;
}
