#include <bits/stdc++.h>
const long long int mod = 1000000007;
using namespace std;
long long int i, n, m, x, y, z, j, k, l, mn = LLONG_MAX, mx = 0, c, a[2000005],
                                         r, cnt = 0, sum = 0, p;
string str;
char ch;
long long int ans, res;
set<long long int> second;
map<long long int, long long int> mp;
vector<vector<long long int>> g;
vector<long long int> v;
char grid[60][60];
long long int d[60][60];
bool vis[60][60];
long long int dx[] = {0, 1, 0, -1, 1, -1, -1, 1};
long long int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool valid(long long int x, long long int y) {
  return (i > 1 && i < n && j > 1 && j < m);
}
long long int power(long long int x, long long int y, long long int p) {
  x = x % p;
  if (x == 0) return 0;
  long long int res = 1;
  while (y > 0) {
    if (y % 2 == 1) {
      res = (res * x) % p;
    }
    y /= 2;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int rem = 0, bag = 0;
  for (long long int i = 0; i < n; i++) {
    if (rem > 0) {
      bag++;
      a[i] -= min(a[i], k - rem);
      rem = 0;
    }
    bag += a[i] / k;
    rem = a[i] % k;
  }
  if (rem > 0) bag++;
  cout << bag << "\n";
  return 0;
}
