#include <bits/stdc++.h>
const int MAXN = 2e7 + 7;
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % 1000000007;
    }
    x = (x * x) % 1000000007;
    y = y >> 1;
  }
  return res;
}
std::vector<int> divi[100004];
void divisor(int n) {
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j += i) {
      divi[j].push_back(i);
    }
  }
}
long long int a[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long int k;
  cin >> n >> k;
  long long int sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum = sum + a[i];
  }
  long long int left = 0;
  long long int x = 0;
  for (int i = 1; i <= n; i++) {
    long long int req = (left / k) + ((left % k == 0) ? 0 : 1);
    long long int cur = a[i];
    left = max(0LL, cur - left % k);
    x = x + req + left / k;
    left = left % k;
  }
  x = x + ((left % k == 0) ? 0 : 1);
  cout << x << endl;
  return 0;
}
