#include <bits/stdc++.h>
using namespace std;
const int N = 1E6;
long long a[N], b[N], n, m, k, ans;
int main() {
  long long i;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    b[i - 1] = -1;
  }
  if (n == 1) {
    ans = a[1] / m;
    if (a[1] % m != 0) ans++;
    cout << ans << endl;
  } else {
    for (i = 1; i <= n; i++) {
      if (i == n) {
        ans = ans + a[i] / m;
        if (a[i] % m != 0) ans++;
        break;
      }
      if (a[i] < m && i != n && b[i - 1] == -1) {
        a[i + 1] += a[i];
        b[i] = a[i];
      } else if (a[i] < m && i != n && b[i - 1]) {
        if (a[i] % m != 0) ans++;
        b[i] = a[i];
      } else if (a[i] >= m) {
        ans = ans + a[i] / m;
        a[i] = a[i] % m;
        a[i + 1] += a[i];
        b[i] = a[i];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
