#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2e5 + 5;
const unsigned long long base = 31;
const long long MOD = 1000000007;
const long long inf = 0x7f7f7f7f;
const double eps = 1e-8;
int s[Maxn];
int vis[Maxn];
int main() {
  long long n, k;
  cin >> n >> k;
  long long cnt = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
  for (int i = 1; i < n; i++) {
    if (vis[i - 1] == 1 && s[i] < k)
      cnt++;
    else {
      cnt += s[i] / k;
      s[i + 1] += s[i] % k;
      vis[i] = 1;
    }
  }
  cnt += s[n] / k;
  if (s[n] % k != 0) cnt++;
  cout << cnt << endl;
}
