#include <bits/stdc++.h>
int main() {
  int n, m, i, z = 0;
  scanf("%d%d", &n, &m);
  int a[200005];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  z = a[0] / m;
  for (i = 1; i < n; i++) {
    z = z + (a[i - 1] % m + a[i]);
  }
  if (a[n - 1] % m != 0) z++;
  printf("%d", z);
}
