#include <bits/stdc++.h>
using namespace std;
const int dir[4][2] = {1, 0, 0, 1, -1, 0, 0, -1};
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
const double pi = acos(-1);
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
long long a[N];
int n, m, k;
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  long long t = 0;
  long long s = 0;
  long long res = 0;
  for (int i = 1; i <= n + 1; ++i) {
    if (t) {
      if (t + a[i] >= k) {
        res++;
        a[i] -= (k - t);
      } else {
        res++;
        a[i] = 0;
      }
    }
    res += a[i] / k;
    t = a[i] % k;
  }
  cout << res << endl;
  return 0;
}
