#include <bits/stdc++.h>
using namespace std;
int cas = 1;
int dxx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dyy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int dx[] = {-1, 0, 0, 1};
int dy[] = {0, -1, 1, 0};
struct node {
  int x, y;
  bool operator<(const node& p) const { return x < p.x; }
};
int main() {
  int n;
  scanf("%d", &n);
  long long k;
  scanf("%lld", &k);
  long long a[200005];
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long sum = 0;
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    sum += a[i];
    long long x = sum / k;
    long long y = sum % k;
    sum = y;
    ans += x;
  }
  sum += a[n];
  ans += sum / k;
  if (sum % k) ans++;
  printf("%lld\n", ans);
  return 0;
}
