#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 2;
const int maxn = 1e5 + 10;
const int maxq = 1e3 + 10;
const int alf = 26;
const int dlm = 1e9 + 7;
const long long mod = 998244353;
string O[] = {"YES", "NO", "Yes", "No", "Impossible"};
int ON = 4;
int main() {
  long long n, k;
  cin >> n >> k;
  long long dir = 0;
  long long a;
  cin >> a;
  dir = a;
  long long ans = a / k;
  dir %= k;
  for (int i = 2; i <= n; i++) {
    cin >> a;
    if (dir > 0) {
      a -= (k - dir);
      ans++;
      dir = 0;
    }
    if (a > 0) {
      ans += a / k;
      dir = a % k;
    }
  }
  cout << ans;
}
