#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int a[maxn];
int main() {
  long long n, k, i, yu = 0, need, sum = 0;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    int symbol = 0;
    cin >> a[i];
    need = (a[i] + yu) / k;
    yu = (a[i] + yu) % k;
    if (need == 0) symbol = 1;
    if (i >= 2 && yu > 0 && yu < k && symbol) {
      need++;
      yu = 0;
    }
    if (i == n && yu > 0) need++;
    sum += need;
  }
  cout << sum;
  return 0;
}
