#include <bits/stdc++.h>
using namespace std;
int n, k;
int w[100010];
int cnt;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", w + i);
  int las = 0;
  for (int i = 0; i < n; i++) {
    int t = w[i] / k;
    if (w[i] % k) t++;
    cnt += (t + las) / 2;
    las = (t + las) & 1;
  }
  if (las) cnt++;
  printf("%d\n", cnt);
  return 0;
}
