#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, MD = 1e9 + 7, INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9, e = exp(1), PI = acos(-1.);
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  long long ans = 0, f = 0;
  for (int i = 0, x; i < n; i++) {
    cin >> x;
    ans += (x + f) / m;
    if ((x + f) % m > f && i || !x)
      ans++, f = 0;
    else
      f = (x + f) % m;
  }
  if (f) ans++;
  cout << ans << "\n";
  return 0;
}
