#include <bits/stdc++.h>
using namespace std;
const long long int M = 1000000007;
const int N = 2001;
const int INF = 1 << 30;
char field[N][N];
int d[N][N];
int main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  long long int answer = 0;
  long long int prev = 0, cur = 0;
  for (int i = 0; i <= n; ++i) {
    if (i < n)
      cin >> cur;
    else
      cur = 0;
    long long int delta = (prev + cur) / k;
    if (delta * k < prev) ++delta;
    cur = max(0ll, cur + prev - delta * k);
    answer += delta;
    prev = cur;
  }
  cout << answer;
  return 0;
}
