#include <bits/stdc++.h>
using namespace std;
int const MOD = 998244353;
int const INF = 1e5;
void solve() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ct = 0;
  long long sum = 0;
  long long expiry = 0;
  for (int i = 0; i < n; i++) {
    if (sum == 0) {
      if (a[i] == k) {
        ct++;
        expiry = 0;
        sum = 0;
      } else if (a[i] < k) {
        sum += a[i];
        expiry = i + 1;
      } else {
        int q = a[i] / k;
        int rem = a[i] % k;
        ct += q;
        a[i] = rem;
        if (a[i] == k) {
          ct++;
          expiry = 0;
          sum = 0;
        } else {
          sum += a[i];
          expiry = i + 1;
        }
      }
    } else {
      if (a[i] + sum <= k) {
        ct++;
        expiry = 0;
        sum = 0;
      } else {
        ct++;
        a[i] -= (k - sum);
        sum = 0;
        expiry = 0;
        int q = a[i] / k;
        int rem = a[i] % k;
        ct += q;
        a[i] = rem;
        if (a[i] == k) {
          ct++;
          expiry = 0;
          sum = 0;
        } else {
          sum += a[i];
          expiry = i + 1;
        }
      }
    }
  }
  if (sum > 0 && expiry == n) ct++;
  cout << ct << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
