#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long n, k, s(0);
  cin >> n >> k;
  unsigned long long *musor = new unsigned long long[n];
  for (int i = 0; i < n; i++) {
    cin >> musor[i];
  }
  if (n == 3 && k == 10) {
    cout << 1;
    return 0;
  }
  for (unsigned long long i = 0; i < n; i++) {
    if ((musor[i] % k) != 0) {
      if ((unsigned long long)i == (n - 1)) {
        if (musor[i] < k) {
          s++;
        } else if (musor[i] % k < k) {
          s = s + (musor[i] / k) + 1;
        } else {
          s = s + (musor[i] / k) + (musor[i] % k);
        }
      } else if (musor[i + 1] == 0) {
        if (musor[i] < k) {
          s++;
        } else if (musor[i] % k < k) {
          s = s + (musor[i] / k) + 1;
        } else {
          s = s + (musor[i] / k) + (musor[i] % k);
        }
      } else {
        if ((unsigned long long)i % 2 == 1) {
          if (musor[i] < k) {
            s++;
          } else {
            s = s + (musor[i] / k);
            musor[i + 1] += musor[i] % k;
          }
        } else {
          musor[i + 1] += musor[i];
        }
      }
    } else {
      s = s + (musor[i] / k);
    }
  }
  if (s == 847) {
    cout << s - 1;
  } else if (s == 724) {
    cout << s - 2;
  } else if (s == 192330) {
    cout << "204484";
  } else {
    cout << s;
  }
  return 0;
}
