#include <bits/stdc++.h>
using namespace std;
long long p = 1e9 + 7;
const long long M = 1e7 + 9;
long long a[M], b[M], ans;
int n, k, m;
long long solve() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    ans += a[i] / m;
    a[i + 1] += a[i] % m;
  }
  cout << ans;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
