#include <bits/stdc++.h>
using namespace std;
int n, k;
long long int a[100009 * 2];
int main() {
  long long int cas = 0, chazhi;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int h = k, flag = 0, ff = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] > k && i != n) {
      if (a[i] % k == 0)
        cas += a[i] / k;
      else {
        cas += a[i] / k;
        a[i + 1] = a[i + 1] + (k - a[i] % k);
      }
    } else if (a[i] > k && i == n) {
      if (a[i] % k == 0)
        cas += a[i] / k;
      else
        cas += a[i] / k + 1;
    } else if (a[i] == k)
      cas++;
    else if (a[i] < k && a[i] > 0) {
      cas++;
      a[i + 1] = a[i + 1] - (k - a[i]);
    }
  }
  printf("%l64d\n", cas);
  return 0;
}
