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