#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(0);
  int n, k, ans = 0;
  vector<int> a;
  cin >> n >> k;
  for (int i = 0; (i) < (n); ++i) {
    int t;
    cin >> t;
    a.push_back(t);
  }
  sort(a.rbegin(), a.rend());
  for (int i = 0; (i) < (n); ++i) {
    while (a[i] > 0) {
      if (a[i] > k) {
        ans++;
        a[i] -= (a[i] > (2 * k)) ? (2 * k) : a[i];
      } else if (a[i] <= k) {
        ans++;
        if (i != n - 1) a[i + 1] -= (a[i + 1] > k) ? k : a[i + 1];
        a[i] = 0;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
