#include <bits/stdc++.h>
using namespace std;
int arr[100005];
int main() {
  ios_base::sync_with_stdio(false);
  int d = 0, poc = 0;
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    int mod = arr[i] % k;
    int need = arr[i] / k;
    if (mod != 0) need++;
    poc += need;
    d += poc / 2;
    poc %= 2;
  }
  if (poc != 0) d++;
  cout << d;
}
