#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 3;
const long long mod = 1e9 + 7;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int visited[60] = {0};
int n;
vector<int> m[60];
void dfs(int root) {
  visited[root] = 1;
  for (int i = 0; i < m[root].size(); i++) {
    int v = m[root][i];
    if (!visited[v]) {
      dfs(v);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i = 0;
  vector<long long> v;
  long long n, a, k, ans = 0;
  cin >> n >> k;
  long long sum = 0;
  long long prevval = -1, val = 0, mod = 0;
  for (i = 0; i < n; i++) {
    cin >> a;
    sum += a;
    prevval = mod;
    val = sum / k;
    mod = sum % k;
    ans += val;
    sum -= val * k;
    if (prevval != 0 && val == 0) {
      ans++;
      sum = 0;
    }
  }
  cout << ans;
  return 0;
}
