#include <bits/stdc++.h>
using namespace std;
using namespace std;
const long long maxll = 1e18;
const long long maxn = 1e5 + 1;
const long double eps = 0.0000001;
long long d, n, m, x, y, z, k, ans = 0, sum;
long long a[101], b[101], c;
string s;
int main() {
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    ans += (x / m);
    if (x % m != 0) ans++;
  }
  if (ans % 2 == 1)
    cout << ans / 2 + 1;
  else
    cout << ans / 2;
  return 0;
}
