#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, re, total = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> re;
    total += re / k + (re % k != 0);
  }
  cout << total / 2 + total % 2;
}
