#include <bits/stdc++.h>
using namespace std;
long long a[20010], b[20010];
int main() {
  long long n, m, cnt;
  while (cin >> n) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    cin >> m;
    cnt = 0;
    if (n == 1) {
      cin >> a[0];
      cnt += a[0] / m;
      if (a[0] % m != 0) {
        cnt++;
      }
      cout << cnt << endl;
      continue;
    }
    for (int i = 0; i < n; i++) {
      cin >> b[i];
      if (i == 0) {
        a[i + 1] = b[i] % m;
        cnt += b[i] / m;
      }
      if (i > 0) {
        if (i + 1 == n) {
          a[i] += b[i];
          cnt += a[i] / m;
          if (a[i] % m != 0) {
            cnt++;
          }
          break;
        }
        if (a[i] != 0) {
          if (b[i] + a[i] <= m) {
            a[i + 1] = 0;
            cnt++;
          }
          if (b[i] + a[i] > m) {
            a[i] += b[i];
            a[i] -= m;
            cnt++;
            a[i + 1] = a[i] % m;
            cnt += a[i] / m;
          }
        }
        if (a[i] == 0) {
          if (b[i] <= m) {
            a[i + 1] = b[i];
          }
          if (b[i] > m) {
            a[i + 1] = a[i] % m;
            cnt += b[i] / m;
          }
        }
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
