#include <bits/stdc++.h>
using namespace std;

template <typename V>
struct fhnode {
	V val;
	fhnode *l, *r, *p, *c;
	int deg;
	bool m;
	template <typename ...T>
	fhnode(T &&...t) :val(t...), deg(0), m(false),
		l(this), r(this), p(nullptr), c(nullptr) {}
};
template <typename V, typename P = less<>>
class FibHeap {
	fhnode<V> root, *min, *deg[48];
	int size_, dmax;
	P pr;
public:
	typedef fhnode<V> *ptr;
	FibHeap() :size_(0), dmax(0) {
		fill(deg, deg + sizeof deg / sizeof*deg, nullptr);
	}
	~FibHeap() {
		queue<ptr> q;
		q.push(&root);
		while (!q.empty()) {
			ptr r = q.front();
			q.pop();
			for (ptr p = r->r; p != r;) {
				if (p->c != nullptr)
					q.push(p->c);
				p = p->r;
				delete p->l;
			}
			if (r != &root)
				delete r;
		}
	}
	int size() const { return size_; }
	bool empty() const { return !size_; }
	const V &top() const { return min->val; }
	template <typename ...T>
	ptr push(T &&...t) {
		ptr m = new fhnode<V>(t...);
		root.r->l = m;
		m->r = root.r;
		root.r = m;
		m->l = &root;
		if (!size_ || pr(m->val, min->val))
			min = m;
		if (deg[0] == nullptr)
			deg[0] = m;
		size_++;
		return m;
	}
	void merge(FibHeap &h) {
		merge(move(h));
	}
	void merge(FibHeap &&h) {
		root.r->l = h.root.l;
		h.root.l->r = root.r;
		root.r = h.root.r;
		h.root.r->l = &root;
		h.root.r = &h.root;
		if (h.size_ && (!size_ || pr(h.min->val, min->val)))
			min = h.min;
		for (int i = 0; i < h.dmax; i++)
			if (deg[i] == nullptr)
				deg[i] = h.deg[i];
		size_ += h.size_;
		dmax = max(dmax, h.dmax);
	}
	void pop() {
		size_--;
		//1
		if (min->c == nullptr) {
			min->l->r = min->r;
			min->r->l = min->l;
		}
		else {
			for (ptr p = min->c->r; p != min->c; p = p->r)
				p->p = nullptr, p->m = false;
			min->l->r = min->c->r;
			min->c->r->l = min->l;
			min->r->l = min->c->l;
			min->c->l->r = min->r;
		}
		deg[min->deg] = nullptr;
		delete min->c, delete min;
		//2
		for (ptr p = root.r; p != &root; p = p->r) {
			int d = p->deg;
			if (deg[d] == nullptr)
				deg[d] = p;
			if (deg[d] == p)
				continue;
			ptr q = p, r = deg[d];
			if (pr(r->val, q->val))
				swap(q, r), p = p->l;
			r->l->r = r->r;
			r->r->l = r->l;
			r->p = q;
			if (!d) q->c = new fhnode<V>;
			q->c->r->l = r;
			r->r = q->c->r;
			q->c->r = r;
			r->l = q->c;
			deg[d] = nullptr;
			deg[d + 1] = q;
			q->deg++;
		}
		//3
		min = root.r;
		dmax = 0;
		for (ptr p = root.r; p != &root; p = p->r) {
			if (pr(p->val, min->val))
				min = p;
			dmax = max(dmax, p->deg + 1);
		}
	}
	template <typename ...T>
	void dec(ptr p, T &&...t) {
		dec(p, V(t...));
	}
	void dec(ptr p, V &&t) {
		if (pr(p->val, t))
			return;
		p->val = t;
		if (p->p == nullptr || !pr(p->val, p->p->val))
			return;
		ptr q = root.r;
		do {
			p->l->r = p->r;
			p->r->l = p->l;
			if (!--p->p->deg)
				delete p->r, p->p->c = nullptr;
			q->l = p;
			p->r = q;
			if (pr(p->val, min->val))
				min = p;
			if (deg[p->deg] == nullptr)
				deg[p->deg] = p, dmax = max(dmax, p->deg + 1);
			q = p;
			p = p->p;
			q->p = nullptr;
			q->m = false;
		} while (p->m);
		if (p->p != nullptr)
			p->m = true;
		q->l = &root;
		root.r = q;
	}
};

int a[111111];
int main() {
	int n, m;
	cin >> n >> m;
	FibHeap<pair<int, int>, greater<>> q;
	for (int i = 0; i < n; i++) {
		scanf("%d", a + i);
		q.push(a[i], i);
	}
	for (int i = 0; i < m; i++) {
		int x = q.top().second;
		q.pop();
		q.push(a[x] /= 2, x);
	}
	long r = 0;
	for (int i = 0; i < n; i++)
		r += a[i];
	cout << r << endl;
	return 0;
}


Measured memory_bytes: 10368